Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts

    Exclamation problems adding h1 tag to my image

    Hi All,

    I have added a h1 tag to my logo and added a title to it but for some reason it has dropped down a line as well.

    here is my code
    Code:
    <div id='logo'>
    <h1>
    <img src='images/logo/thelogo.png' 
    title="Kernow Connect - For the smarter shopper" 
    alt="Kernow Connect - For the smarter shopper"
    height='125'
    width='340'
    border='0' />
    </h1>
    </div>
    does this look right?

    cheers ALL
    Luke

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    does this look right?
    No. height and width are deprecated attributes.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts
    oh ok thanks for that,

    unfortunatly it hasnt fixed the problem with the image being moved down a line, it only happened since i added the h1 tags?

    cheers for your time mate
    Luke

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Try adding
    Code:
    h1{
    margin:0;
    padding:0
    }
    . Could you post a link to your page?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    LJackson (04-03-2009)

  • #5
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts
    thanks mate that worked a treat

    just out of curiosity why does a h1 tag add margins and padding?
    seems strange to me, (but then again all this web development is )

    Luke

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    All browsers apply some default styles on almost all elements. You may see a sample style sheet at http://www.w3.org/TR/CSS21/sample.html

    This is why, it's considered as a best practice to add a CSS rule like
    Code:
    *{
    margin:0;
    padding:0
    }
    in our CSS, to override all browser specific defaults of margins and paddings. After that we may add the specific values if required, to get a uniform appearance in all browsers.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Abdura, height and width are not deprecated values on the img element and are there to stop the page jumping about before the client can retrieve the image data. Usage is actually recommended. The border attribute is another issue.

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Yeah, I know. I wasn't specific there Thanks for correcting me.
    Last edited by abduraooft; 04-04-2009 at 07:41 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #9
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    Quote Originally Posted by abduraooft View Post
    Yeah, I know. I wasn't specific there
    Or did you.......


    lol


    jk jk jk


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •