Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,374 Programmers. There are 1,419 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

trouble with margins again

 
Reply to this topicStart new topic

trouble with margins again

didgy58
post 4 May, 2008 - 04:47 PM
Post #1


D.I.C Head

**
Joined: 23 Oct, 2007
Posts: 121



hi guys got a slight problem, testing a site right now, now under ie 7 the top of the margin lines up nicely with the top of the page, so that the image of the wrapper lines up nicely with the background image, but in safari and firefox the wrappers margin,starts down the page a little? any suggestions, i was thinking of putting a negative top margin on the wrapper but then would this have a major effect of ie?

CODE

body {
    padding:0;
    margin:0;
height:100%;
width:100%;
text-align:center;
background-image:url(images/BGBIG.gif);
}

/* page layout styling */

#wrapper {
margin:0 auto;
width:1000px;
height:1200px;
background-image:url(images/BGBIG.gif);
background-repeat:no-repeat;
position:relative;

}

#center {
text-align:center;
min-height:300px;
height:auto !important;
height:300px;
color:white;
}


thats the css so far

and the html looks like this

CODE

<body>
<div id="wrapper">

<div id="header">

</div>
        <div id="leftcol">

        </div>

        <div id="center">

<p><img id="logo" src="include/images/logo.png" alt="PandBJoinery" /></p>
<br /><div id="blurb">
<p>P and B joinery Website Under Construction</p>
<p>Please Telephone <strong>01656 746600</strong> </p>
</div>
<br />
<p><img id="logo" src="include/images/bedrooms.png" alt="PandBJoinery" />
<img id="logo" src="include/images/logokitchens.png" alt="PandBJoinery" />
<img id="logo" src="include/images/Logobathroom.png" alt="PandBJoinery" /></p>
        </div>

        <div id="rightcol">
        </div>

        <div id="footer">

        </div>

    </div>
<?php
include 'include/tracker.js';
?>
</body>


i think ive had this trouble once before but wasnt sure how i got about it?

thanks again

dan.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post


BenignDesign
post 4 May, 2008 - 08:09 PM
Post #2


D.I.C Regular

Group Icon
Joined: 28 Sep, 2007
Posts: 485

You could use an <!--[ifIE]> line with top-margin set to 0, then add a negative top-margin for ff and safari.

I know the practice is frowned upon, but it works tongue.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

didgy58
post 5 May, 2008 - 01:35 PM
Post #3


D.I.C Head

**
Joined: 23 Oct, 2007
Posts: 121

never thought of doing it like that, ive sorted it now,

added a

CODE

*{
margin:0;
padding:0;
}


and it seemed to sort it all out nicely. thanks for the advice though.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

JasonMcAuley
post 7 May, 2008 - 07:22 AM
Post #4


D.I.C Head

**
Joined: 10 Apr, 2008
Posts: 122

One day... maybe one day... browsers will all follow a single standard for CSS...


Glad you found a solution smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:52AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month