txt wont stay in the right place..ULR... One validation. XMAS

D

DJS2C

I just cant get txt to stay in the same place I know I have tried a odd way
(or not so odd as it's CSS positioning, yes?) but with loads of breaks etc.
The first page the text just wont stay on the stars! Anyone.!

And the only thing stopping it validating is

Line 114, column 32: there is no attribute "HEIGHT"

<table width="700" height="392" border="0" cellpadding="0">

Surley I can have a 'height' in my table?

Will be moving on to layers and divs soon, promise :) Do you recomemd them
for my large project even though I hant used them before..A bit scared lol

Cheers if you can help
Happy Christmas
James

www.midsussextransport.co.uk
 
O

Oli Filth

Arrgh! No offence, but that's a hideous way of getting the text inside
your stars. What happens if you want more stars? You'll have to edit the
JPEG, and then re-experiment with breaks. What happens if you change the
font-size? Again, you'll have to sod about with the breaks. More
importantly, what happens if the user has a different default font-size
that overrides yours? Then it'll never work.

That's not CSS positioning. Here's an example of how to do this
"properly" (others may argue that there are better ways, but it works):

<HTML>
<HEAD>
<STYLE type="text/css">
DIV.star
{
background-image: url("star.jpg");
background-repeat: no-repeat;
width: 177px; /* Width of star.jpg */
height: 128px; /* Height of star.jpg */
line-height: 128px;
text-align: center;
text-transform: uppercase;
font-weight: bold;
}
</STYLE>
</HEAD>
<BODY>
<P>
Some text.
</P>
<DIV class="star">
Holiday breaks!
</DIV>
<P>
Some more text.
</P>
</BODY>


As for table height, HTML 4.01 doesn't specify height as an attribute
for tables. Presumably because table-height is determined by the size of
the contents inside.

Hope this helps,
Oli
 
O

Oli Filth

Oops, I should've mentioned that in my example, star.jpg is an image of
the star on its own, with no white-space surrounding it (i.e. the edges
of the stars should be at the edges of the image).

I thoroughly recommend learning how to use DIVs, they're extremely
flexible (when combined with CSS), and you're severely limited in what
you can achieve without them. Once you get your head round them and
learn some funky CSS stuff like floats and inline-content, you can do
away with the massive table that your front page is currently made from.

Oli
 
D

DJS2C

Thanks Oli , most helpful. Good idea to do each star as it's own graphic.
Should have tried that. It's all one picture at the moment.
James


Oli Filth said:
Arrgh! No offence, but that's a hideous way of getting the text inside
your stars. What happens if you want more stars? You'll have to edit the

Yep.
 
D

DJS2C

Oli Filth said:
Oops, I should've mentioned that in my example, star.jpg is an image of
the star on its own, with no white-space surrounding it (i.e. the edges
of the stars should be at the edges of the image).

I thoroughly recommend learning how to use DIVs, they're extremely
flexible (when combined with CSS), and you're severely limited in what
you can achieve without them. Once you get your head round them and
learn some funky CSS stuff like floats and inline-content, you can do
away with the massive table that your front page is currently made from.

Good Show Old Chap :). Thanks mate I meen :). . I will do now what about
putting divs on my table and then removing the code out of the table (to fix
some browser resize problems)?

James
 

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top