Jump to content

[SOLVED] linebreak after div...


blufish

Recommended Posts

Okay here is my code

<html>
<head>
<title>My Site</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
background-image: url('back.gif');
background-color: #cccccc;
}
p {margin: 10px 10px 10px 10px;}
div {design: inline;}
</style>
</head>
<body><center>
<div style="background-image: url('fore.gif'); background-color: 330099; width: 80%; margin-bottom: 0px;"><img src="logo.gif" width=75%><br><img src="slogan.gif" width=35%></div><div style="background-color: white; width: 80%; text-align: left; text-margin: 10; margin-top: 0px;">
<p>Lorum ipsum dolor and all that other stuff...</p>
</div>
</body>
</html>

 

My problem is that in Internet Explorer there is no space between the boxes (thats what I want).  But in Safari and Flock there is a space there, how can I get rid of the space?

Link to comment
Share on other sites

I would really LOVE to help and so would many other people... but you need to understand that just "dumping" code won't help. I can barely read that html code because it is poorly formatted.

 

Please follow a formatting standard (like this one):

<html>

    <head>
        <title>Something</title>
    </head>

    <body>
        .......
    </body>

</html>

 

Isn't that easier to read?

Link to comment
Share on other sites

Got it!

 

<html>
<head>
	<title>My Site</title>
	<style type="text/css">
		body {
		margin: 0;
		padding: 0;
		background-image: url('back.gif');
		background-color: #cccccc;
		}
		p {margin: 10px 10px 10px 10px;}
		div {design: inline;}
	</style>
</head>
<body>
	<center>
	<div style="background-image: url('fore.gif'); background-color: 330099; width: 80%; margin-bottom: 0px;"><img src="logo.gif" width=75%><br><img src="slogan.gif" width=35%></div>
	<div style="background-color: white; width: 80%; text-align: left; text-margin: 10; margin-top: 0px;">
	<p>Lorum ipsum dolor and all that other stuff...</p>
	</div>
</body>
</html>

Link to comment
Share on other sites

Works perfectly fine.

 

<div style="background-image: url('fore.gif'); background-color: 330099; width: 80%; margin-bottom: 0px;">
        <img src="logo.gif" width=75%>
        <div style="clear:both;"></div>
        <img src="slogan.gif" width=35%>
        </div>
<div style="background-color: white; width: 80%; text-align: left; text-margin: 10; margin-top: 0px;">
        <p>Lorum ipsum dolor and all that other stuff...</p>
</div>

Link to comment
Share on other sites

Works perfectly fine.

 

<div style="background-image: url('fore.gif'); background-color: 330099; width: 80%; margin-bottom: 0px;">
        <img src="logo.gif" width=75%>
        <div style="clear:both;"></div>
        <img src="slogan.gif" width=35%>
        </div>
<div style="background-color: white; width: 80%; text-align: left; text-margin: 10; margin-top: 0px;">
        <p>Lorum ipsum dolor and all that other stuff...</p>
</div>

The space inbetween the divs is still there in flock and safari.

Link to comment
Share on other sites

Since you have no bottom margin on the top div, and no top margin on the bottom div, the only thing I can think that it may be is that there is a margin on the image inside the top div. Set the margin on the images to zero, and see what happens.

 

<div style="clear:both;"></div>

 

is an appropriate line break for div/css

 

I don't know where you ever got that idea. It's not a line break at all, much less an appropriate one.

Link to comment
Share on other sites

Since you have no bottom margin on the top div, and no top margin on the bottom div, the only thing I can think that it may be is that there is a margin on the image inside the top div. Set the margin on the images to zero, and see what happens.

 

<div style="clear:both;"></div>

 

is an appropriate line break for div/css

 

I don't know where you ever got that idea. It's not a line break at all, much less an appropriate one.

 

after reading his confusing question and script twice i realized that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.