CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 4th, 2004, 02:51 AM
Sheqel Sheqel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 16 Sheqel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 23 sec
Reputation Power: 0
CSS negative margin screws in IE

im using (stripped most) CSS:

Code:
h3 {
    margin-top:-10px;
    }


in this HTML

Code:
<h1>Header</h1>
<h3>subtitle</h3>


i want the <h3> the overlap the <h1> partly, like defined in the CSS. It works fine in every browser, but in IE, the rest of the page is distored because of the negative margin definition.

is there any workaround for this

Reply With Quote
  #2  
Old May 4th, 2004, 03:18 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,585 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 16 h 15 m 44 sec
Reputation Power: 662
Use
Code:
h3 {
    position: relative;
    top: -10px;
    }
Using position: relative preserves the natural position of the element. The top: -10px; simply shifts the element without affecting other elements.

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #3  
Old May 4th, 2004, 04:38 AM
Sheqel Sheqel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 16 Sheqel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 23 sec
Reputation Power: 0
thx for the reply.

it works partly the page is still distorted, but less. now other DIV elements shift a little too much to the right in IE :S

Last edited by Sheqel : May 4th, 2004 at 04:40 AM.

Reply With Quote
  #4  
Old May 4th, 2004, 08:01 AM
stinkoman's Avatar
stinkoman stinkoman is offline
what's your moniker?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Highland Park, NJ
Posts: 201 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to stinkoman
you could try...

You could try putting the two h tags in a div with position relative with no top or left defined.
Then make the h tags absolute - they will be positioned within the containing div, not for the whole document. Then you don't have to worry about them affecting the rest of the page.
__________________
new jersey web design

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS negative margin screws in IE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT