Spacing on pictures on framed part of page??????

C

chrisdude911

Hey guys
I am having a problem with frames on my site

On http://www.chriswillisdude.pwp.blueyonder.co.uk/

you can see that there is a gap on the top part of the page between
the egde of the page and the pictures
is there a way to fix this?

This is my code:

<html>
<head>
</head>
<body>
<img src="background.jpg" width="1000" height="118" border="0">
</body
</html>

Thanks
Chris
 
J

Jonathan N. Little

chrisdude911 said:
Hey guys
I am having a problem with frames on my site

On http://www.chriswillisdude.pwp.blueyonder.co.uk/

you can see that there is a gap on the top part of the page between
the egde of the page and the pictures
is there a way to fix this?

Fix your markup which is not valid
This is my code:

<html>
<head>
</head>
<body>
<img src="background.jpg" width="1000" height="118" border="0">

IMG is a inline element and should be contained in a block element

The closing tag of your body element is malformed said:
 
C

chrisdude911

I am new to this
Would you mind explains waht a "block element" and an "inline element"
mean?
Thanks
Chris
 
C

chrisdude911

<html>
<head>
</head>
<body>
<p>
<img src="background.jpg" width="1000" height="118" border="0">
</p>
</body>
</html>

is that right
because that still didnt fix it

thanks
chris
 
B

Ben C

<html>
<head>
</head>
<body>
<p>
<img src="background.jpg" width="1000" height="118" border="0">
</p>
</body>
</html>

is that right
because that still didnt fix it

<p> is a block-level element, but so is <body>. The <p> is not
necessary; as far as I can see there's nothing wrong with putting <img>
directly inside body.

The gap is just the default margin on body. If you don't want the gap,
add body { margin: 0; } to the styles or write <body style="margin: 0">.
 
R

Roy A.

I am new to this
Would you mind explains waht a "block element" and an "inline element"
mean?

The body element can only contain block elements or inline (text
level) elements. If you're using a HTML 4.01 Strict DOCTYPE you
should put the img element in an block element, because this DOCTYPE
only allows block elements directly inside the body element.

<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->

http://www.w3.org/TR/html401/struct/global.html#edef-BODY

Block elements is defined as

<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

http://www.w3.org/TR/html401/sgml/dtd.html#block

Inline elements is defined as

<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; |
%formctrl;">

http://www.w3.org/TR/html401/sgml/dtd.html#inline

INS and DEL is either block or inline, depending on the context.

Inline elements can only contain text or other inline elements. Block
level elements can, depending on the element, contain inline elements
and text; block elements, or a mix of those elements.

Beside block and inline elements, you can also use script elements
inside the body element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top