Jump to content

[SOLVED] So much for specifying widths


jordanwb

Recommended Posts

I'm trying to rewrite the default theme engine of my SCM because despite the fact that the widths are specified exactly, the widths change. So I'm rewriting it using divs, and it's not much better:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Div Test</title>
<style type="text/css">
<!--
BODY
{
background-color: #CCCCCC;
}
.container
{
border: 1px solid black;
margin-left: auto;
margin-right: auto;
width: 1000px;
}
.row_1_container
{
background-color: green;
width: 100%;

}
.row_2_container
{
background-color: red;
width: 100%;
}
.row_3_container
{
width: 100%;
}
.row_3_column_1_container
{
background-color: blue;
display: inline;
width: 200px;
}
.row_3_column_2_container
{
background-color: purple;
display: inline;
width: 600px;
}
.row_3_column_3_container
{
background-color: orange;
display: inline;
width: 200px;
}
.row_4_container
{
width: 100%;
}
.row_4_column_1_container
{
background-color: yellow;
display: inline;
width: 50%;
}
.row_4_column_2_container
{
background-color: cyan;
display: inline;
width: 50%;
}
.row_5_container
{
background-color: magenta;
width: 100%;
}
-->
</style>
</head>
<body>
    <div class="container">
        <div class="row_1_container">
        	 
        </div>
        <div class="row_2_container">
        	 
        </div>
        <div class="row_3_container">
            <div class="row_3_column_1_container">
            	 
            </div>
            <div class="row_3_column_2_container">
           	  
            </div>
            <div class="row_3_column_3_container">
           		 
            </div>
        </div>
        <div class="row_4_container">
            <div class="row_4_column_1_container">
            	 
            </div>
            <div class="row_4_column_2_container">
            	 
            </div>
        </div>
        <div class="row_5_container">
        	 
        </div>
    </div>
</body>
</html>

 

The three divs in the third row are not the right widths and neither are the ones in the fourth row.

Link to comment
Share on other sites

I took a look at your code, (puke, puke)   :-\ :P:o

 

First of all, what I'm about to say is simply for your benefit. If you don't like my advice, then don't use it......

 

You need to enclose all text within a block level tag. <p> is a really good tag. You can not let text go into a <td> by itself! <span> doesn't count either!

 

Make sure you self close certain tags. <img /> . Notice the self ending code?

 

Finally, whenever making a list, like the user menu, put each link is a list. <ul><li>....

 

All of these suggestions will help your SEO, make it more accessible, and make it more semantically correct.  :P

Link to comment
Share on other sites

You need to enclose all text within a block level tag. <p> is a really good tag. You can not let text go into a <td> by itself! <span> doesn't count either!

 

I don't see what the big deal is but okay.

 

Make sure you self close certain tags. <img /> . Notice the self ending code?

 

Yeah, I do that.  ???

 

Finally, whenever making a list, like the user menu, put each link is a list. <ul><li>....

 

All right.

 

I need to make changes to the PHP code, so I'll add that to the list of stuff to change.

Link to comment
Share on other sites

The reason text must be enclosed in block elements is because otherwise, (logically thinking) normal english text that you have in raw html code would have no higher significance than some other tag, link, or some other jumbo mambo. It's a far fetch way of thinking about it, but just think, do search engine bots are smart enough to view your page as a web browser? - NO. They strip tags out here and there.... by putting block tag elements outside of your text puts a high level of importance into your text - puts meaning in color blind search engines!  :P

Link to comment
Share on other sites

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.