Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2013, 12:28 AM   PM User | #1
Zeke2
New Coder

 
Join Date: Oct 2010
Posts: 30
Thanks: 11
Thanked 0 Times in 0 Posts
Zeke2 is an unknown quantity at this point
Is this the right way to structure a website?

Hi, I was wondering if this is an appriopriate way for structuring a website. I think it'll work? But I don't know if this is the right way or just another way of doing it. Any advise would be appriciated

Code:
<!DOCTYPE html>
<html>
<head>
<style>

div.ex { 
margin:auto;
width:800px;
height:1200px;
padding:1px;
border:1px solid blue;
}

div.exe {
margin:auto;
width:600px;
height:100px;
border:1px solid red;
}

div.exe2 {
margin:auto;
width:798px;
height:20px;
border:1px solid red;
}

div.exe3 {
float:left;
width:50px;
height:500px;
border:1px solid red;
}

div.content {
float:left;
width:700px;
height:500px;
border:1px solid red;
}

div.right {
float:left;
width:44px;
height:500px;
border:1px solid red;
}
</style>

</head>
<body>
<div class="ex">
    <div class="exe">banner
    </div>
    <div class="exe2">Nav
    </div>  
    <div class="exe3">VerNav fffffffff
    </div>     
    <div class="content">Content
    </div>
    <div class="right">Right nav
    </div>
</div>     
</body>
</html>
Zeke2 is offline   Reply With Quote
Old 01-14-2013, 01:02 AM   PM User | #2
linek98
New Coder

 
Join Date: Dec 2012
Location: England
Posts: 18
Thanks: 0
Thanked 4 Times in 4 Posts
linek98 is an unknown quantity at this point
I'm not sure what you are asking for.
1. Naming, class/id should say something about an element it is assigned to.
2. If you are certain that only one element will implement styles, then I suggest you use ID.
3. HTML5 adds tags like section, footer, header, aside, etc. Use those (was going to paste http://www.w3.org link here but I'm unable to connect to their website >.>). Those tags however will not work on browsers like IE8, to fix it just use http://code.google.com/p/html5shiv/.

It is up to you how you build your website. Just follow standards and it should be displayed properly on most browsers.
linek98 is offline   Reply With Quote
Old 01-14-2013, 01:25 AM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello Zeke2,
Like linek98 suggests, a more descriptive naming convention makes it easier to know what each div element is.
Other than that, your layout is not so bad. There are some errors that validating could help you with. See the links about validating in my signature line.

I think you are off to a good start.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:28 PM.


Advertisement
Log in to turn off these ads.