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 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need explinations about CSS and IMG tags

    first off, on w3c, they say to start using
    <META http-equiv="Content-Style-Type" content="text/css">
    in your html documents, can someone please explain why this is nessesary and the benifits in using this? to either browsers or anything...

    second thing, i was told by my instructor that defining the image size will speed up loading of images and things.
    so, ie:

    if i got an img tag such *** <img src="img.gif"> and the image is 200x200px

    is there going to be a faster load if the image is <img src"img.gif" width="200" height="200">

    and why.

    i kno maybe an anoying question but my instructor didnt really answer it to how i could understand him, any help on both those questions would be nice

    thankyou for your time.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    when you specify the size of an image the browsers knows in advance how much space to reserve for it and can start rendering the page without having to wait-and-see how large it is. It's faster and looks better.

    As for the meta tag, I'm not sure.. but since it says 'text/css' I don't think it should be used in a page. Pages are 'text/html'. External CSS is 'text/css'.

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    That <meta/> tag just tells the browser that the default stylesheet type is text/css.

    It is not necessary if you explicitly say that each stylesheet is text/css in the <link/> or <style> tags.

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah thanks you 2 :-)

    and yeh i always write:

    <link rel="stylesheet" type="text/css" href="something.css">

    so i guess the meta is not 'needed' eh?
    :-)

    appreciate it.

    and that image thing, i'll have to try it with netscape to see if theres any load time differences on one of my pages that has a ton of artwork.

    Peace

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just to add a little tidbit i read just now on ALA:
    Declaring which stylesheet(s) are available in the meta data will enable those browsers that have this ability to have the user switch style sheets; obviously, only really interesting when there's more than one... (read ALA's article on their PHP style switcher).
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #6
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by MCookie
    when you specify the size of an image the browsers knows in advance how much space to reserve for it and can start rendering the page without having to wait-and-see how large it is. It's faster and looks better.
    in the end it all looks the same tho right?

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.


  •  

    Posting Permissions

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