Forum Moderators: open
<style>
#content {
background: #FFF;
width: 975px;
min-height: 400px
}
#rt_col { width: 330px }
@media (max-width: 974px) {
#content { width: 780px !important }
#rt_col { display: none }
}
</style>
<table class="content">
<tr>
<td id="main">
Main content
</td>
<td id="rt_col">
Ads and other stuff
</td>
</tr>
</table> <style>
main {
background: #FFF;
width: 975px;
min-height: 400px;
position: relative
}
section {
display: inline-block;
width: 645px
}
aside {
position: absolute;
top: 0;
display: inline-block;
width: 330px
}
@media (max-width: 974px) {
main { width: 780px !important }
section { width: 100% !important }
aside { display: none }
}
</style>
<main>
<section>
Main content
</section>
<aside>
Ads and other stuff
</aside>
</main> Your CSS assigns an ID (#) to the table, but the html is calling for class: <table class="content"> that should be <table ID="content">
<content> has a purpose in html5
I would seriously consider using <div s in place of tables, it cuts down on a lot of code.
Are you suggesting that I use DIV tags with IDs instead of HTML5 tags?I suggest not to use IDs unless you really need to, because each ID can only apply to one element on a page.
<header>
main website banner
<nav>
main site links
</nav>
</header>
<main>
<article>
<h1>
main content
</article>
<section>
comments and other stuff related to the article
</section>
</main>
<aside>
sidebar ads and other links not related to the article
</aside>