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 02-15-2013, 01:57 PM   PM User | #1
vipercode
New Coder

 
Join Date: Jan 2013
Posts: 21
Thanks: 13
Thanked 0 Times in 0 Posts
vipercode is an unknown quantity at this point
Tempate Demo Help

I have created a template trying to use the modern html 5 way but columns can't seem to get the right with and margin. also with having borders on some parts it makes it look bigger but not I have created a link for you all to see feel free to play around with it and if you have ago tell me what you think I have done wrong so I can learn

Here is the link http://codepen.io/vipercode/pen/eGyDz

Full Page View Link is Here: http://codepen.io/vipercode/full/eGyDz

I also would like each section to have a background width 100% with different Colors. And the container stays at 960px;

I use to do it ok with html 4 but not new html 5 won't take me long to learn once I get a demo from somewhere.
vipercode is offline   Reply With Quote
Old 02-15-2013, 05:41 PM   PM User | #2
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
Good morning vipercode,
You should check this with the validator. You have title and meta in the body of the document. You also re-use #main a lot.

Your .col's don't make three columns because you don't follow the box model.
See the box model here. The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all count when figuring width/height.
---An example of your box model being off:
header#main is 60em wide
In that you put 60em wide #logo PLUS 2px of borders.
You also don't clear your floats.
One handy thing about using overflow: auto; to clear floats with is it will show you when your box model is off by giving you a scrollbar.
__________________
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
Users who have thanked Excavator for this post:
vipercode (02-16-2013)
Old 02-16-2013, 02:55 AM   PM User | #3
vipercode
New Coder

 
Join Date: Jan 2013
Posts: 21
Thanks: 13
Thanked 0 Times in 0 Posts
vipercode is an unknown quantity at this point
Going to watch some more learning videos on html 5 elements etc.


Quote:
Originally Posted by Excavator View Post
Good morning vipercode,
You should check this with the validator. You have title and meta in the body of the document. You also re-use #main a lot.

Your .col's don't make three columns because you don't follow the box model.
See the box model here. The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all count when figuring width/height.
---An example of your box model being off:
header#main is 60em wide
In that you put 60em wide #logo PLUS 2px of borders.
You also don't clear your floats.
One handy thing about using overflow: auto; to clear floats with is it will show you when your box model is off by giving you a scrollbar.
vipercode is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html

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 11:23 PM.


Advertisement
Log in to turn off these ads.