Jump to content

Recommended Posts

On internet.

At home.

At school.

Anywhere.

 

At the sticky in this forum look you should. Useful links a lot there are.

 

*bad pun* But not in church, they love their rows... */bad pun*

 

LOL good pun.

 

 

www.w3schools.com

Div's, but you have to design correctly with the css or your div's will end up where you didn't want them to be...

 

Personally I prefer to design with tables seeing that it's more stable, but when I revamp my website I'm going over to div's

I recommend divs + tables. Tables should only be used for tabular data.

 

You should strive to design SEMANTIC websites - use as few divs as possible to achieve the same design. A typically beginner will create div soup.

 

For example:

<div id="main">
  <div class="heading">I am a heading in a div.</div>
  <div class="text">Text goes here... blah blah</div>
  <div class="image"><img src="../..images/something.png" width="50" height="50" alt="ALT text" /></div>
</div>

 

This is div soup. It isn't any better than tables!

 

You should do this instead:

 

<div id="main">
  <h1>Heading Goes here!</h1>
  <p class="text">Text goes here... blah blah</p>
  <img src="../..images/something.png" width="50" height="50" alt="ALT text" />
</div>

 

Remember, CSS is powerful enough that you can literally format these tags too! Actually, this technique will reduce your code since you don't have to specifiy classes, if you only use a tag once within a div parent.

 

Finally, NEVER enclose text in only a div. This is terrible semantics. Always enclose it in a block level text tag. <li>, <p>, <h1>, etc.

TheFilmGod is right.

 

AND, once you get rid of all the code bloat (table tags, too many div tags, etc) you will almost immediately notice better natural search engine ranking.

 

SEO is all about making it easy for the bot to spider your pages. Semantic content shows the bot what is important.

There are many sites that you can learn CSS from. If you're a starter, You should take a look at W3 CSS school. Or one of my favorites cssbasics.com. Once you get going, use tools like stumbleupon to find different css tricks and tips to practice your skill.

going table less is easier than you may think.  Study the use of float and clear.

 

.floating {
float:left;
margin:5px;
border:1px solid black;
background-color:red;
}

.push {
clear:left;
}

 

<div class="floating"></div>
<div class="floating"></div>
<div class="floating"></div>
<div class="push"></div>

 

This should output 3 red boxes with a black border all on one line separated by 5px.

Without the float:left; they would appear from top to bottom instead of left to right.

float:right would make them display right to left instead of left to right. Use clear to stop floating block objects.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.