SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML attribs --> CSS. Is this right?

    Code:
    <img src="pic.gif" width="8" height="11" hspace="6" align="absmiddle" />
    with CSS becomes
    Code:
    <img src="pic.gif" class="navArrow" />
    
    <style>
    img.navArrow {
    	width: 8px;
    	height: 11px;
    	padding-left: 3px;
    	padding-right: 3px;
    	Don't know the align....HELP!
    	}
    </style>
    Thanks
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  2. #2
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty much so, I think. :-)

    Align="absmiddle" would be the, "vertical-align: middle;" property. You could also use, "padding: 0 3px;" if you want to type less for that padding part.

    Hope This Helps :-D

    ~~Ian
    Last edited by Ian Glass; Aug 8, 2002 at 10:27.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually...you shouldn't use CSS to define the height and width of an image. Those are valid attributes of the IMG tag. Not only does it not save coding, it seperates bits of data on the page. This would make it harder to make modifications to the IMG tag because you've got bits in two places.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. But in every place that image appears it will be the same, so I won't need to modify it ever on a case-by-case basis.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    true but when would you ever modify that image? Likely not until the next redesign in which case you would have larger recoding issues anyway.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but you've lost me. I understand that it may be bad practice to use CSS for the width and height of an image, but how is not doing it less work?

    <img src="pic.gif" class="navArrow" />
    38 keystrokes

    <img src="pic.gif" width="8" height="11" class="navArrow" />
    60 keystrokes

    Am I missing something?
    Last edited by beetle; Aug 8, 2002 at 16:48.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So when you redesign your site, all you're planning on changing is that arrow gif?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I think we are both confused. I'm creating a site from scratch. Brand new. I have these little arrow images in lots of places. I used the style the way I had it so it would be less typing for each instance. That's it.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  9. #9
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you've typed more in this thread than you would've either way! :-p

    :-D

    ~~Ian

    P.S. Personally, I don't usually explicitly specify the size through HTML or CSS since I'd design the graphic to size--I figure, "why bother?"

  10. #10
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was thinking the same thing. Now let me ask you something about your P.S. I ALWAYS design graphics to size, to, but don't browsers render stuff faster when you give them the dimensions?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  11. #11
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I've heard that. And it probably means that the browser can draw more accurately for the first pass, too. I'd probably state the dimensions if I were doing rounded corners, but since I don't do a lot of those, I don't even bother.

    I donno, one of those Ian quirks, I guess... ;-)

    ~~Ian


Bookmarks

Posting Permissions

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