Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 12-06-2011, 09:58 AM   #1
New Member
 
Join Date: Dec 2011
Posts: 1
Default please help, simple HTML problem

Hi, I am coding this page:

http://www.gadgetgeeky.co.uk/alpha/produtos.html

The main page has a header (h3) which I wanted to bring close to the top but for some reason if I change the CSS to H3{margin-top:-20px;} then the whole <div> move (I just want the header to come up), please advise what am I doing wrong?

Thanks
luizarios is offline   Reply With Quote


Old 12-06-2011, 04:16 PM   #2
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default

It s block level element and when you decrease the top value all other elements below will adjust accordingly. It's called document flow. If you want to keep the div below in the same location try adding a bottom margin. Also the heading element is bold by default so there is no need to declare this in the css rule.

For example:
Code:
div#products {
margin:-20px 5px 30px;
font-size: 24px;
color: red;
}
Alternatively, you could also try using the css properties "height" and "line-height".
__________________
John Darling
Graphic / Web Designer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
PixelPusher is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:30 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.