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

Discussion in 'HTML' started by DJS2C, Dec 21, 2004.

  1. DJS2C

    DJS2C Guest

    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
     
    DJS2C, Dec 21, 2004
    #1
    1. Advertising

  2. DJS2C

    Oli Filth Guest

    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


    DJS2C wrote:
    > 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
    >
    >
     
    Oli Filth, Dec 21, 2004
    #2
    1. Advertising

  3. DJS2C

    Oli Filth Guest

    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

    Oli Filth wrote:
    > 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
    >
    >
    > DJS2C wrote:
    >
    >> 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
    >>
    >>
     
    Oli Filth, Dec 21, 2004
    #3
  4. DJS2C

    DJS2C Guest

    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" <> wrote in message
    news:ZlLxd.2192$...
    > 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.
     
    DJS2C, Dec 21, 2004
    #4
  5. DJS2C

    DJS2C Guest

    "Oli Filth" <> wrote in message
    news:stLxd.2194$...
    > 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


    > Oli
    >
    > Oli Filth wrote:
    > > 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
    > >
    > >
    > > DJS2C wrote:
    > >
    > >> 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
    > >>
    > >>
     
    DJS2C, Dec 21, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig G
    Replies:
    0
    Views:
    406
    Craig G
    Mar 7, 2005
  2. Net5
    Replies:
    9
    Views:
    523
    ApicalSoft
    Nov 20, 2004
  3. pjpf1

    rewitten ULR

    pjpf1, Apr 9, 2007, in forum: Java
    Replies:
    2
    Views:
    364
    pjpf1
    Apr 10, 2007
  4. azrael
    Replies:
    1
    Views:
    298
    azrael
    Oct 12, 2008
  5. michael

    Colour-by-ULR dropdown menu modifier

    michael, May 11, 2005, in forum: Javascript
    Replies:
    5
    Views:
    102
    Thomas 'PointedEars' Lahn
    May 15, 2005
Loading...

Share This Page