SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot mr_invisibile's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver, Canada
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change "align" attribute of <img> tag to CSS?

    Anyone have any idea how I could make a class or id (preferably class!) of the following html code.

    HTML Code:
    <img src="arrow.gif" width="10" height="10" align="absmiddle" />links
    Its not essential but it would make my pages easier to modify and less work if i knew how to do it in CSS...

    Thanks
    btard deleted nostatus
    Page Rank: Great for selling ads to media buyers, otherwise it is worthless.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,868
    Mentioned
    159 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    I think this is what you want.
    css:
    Code:
    .arrow {vertical-align:middle;}
    html:
    Code:
    <p><img src="arrow.gif" width="10" height="10" class="arrow" />links</p>
    This will align the image to the centre of the text.

    (BTW absmiddle has been deprecated and isn't valid html anymore).

    Paul

  3. #3
    SitePoint Zealot mr_invisibile's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver, Canada
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey I tried it before I posted (admittedly I was using Dreamweaver) and it didnt appear in the design view of Dreamweaver so i thought it hadnt worked.... Doh!!! (*slaps head*)...

    Thanks
    btard deleted nostatus
    Page Rank: Great for selling ads to media buyers, otherwise it is worthless.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,868
    Mentioned
    159 Post(s)
    Tagged
    4 Thread(s)
    didnt appear in the design view of Dreamweaver
    I don't bother with design view in DW when using CSS anymore. (Unless its DW2004 which is much better with CSS but the trial version ran out and I don't know whether I can afford to upgrade yet .)

    Paul

  5. #5
    SitePoint Zealot mr_invisibile's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver, Canada
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that was gona be my next question - regarding dw2004... Anyway I should have more faith in my own knowledge and test the alignment outside of design view in dw.

    Thanks again
    btard deleted nostatus
    Page Rank: Great for selling ads to media buyers, otherwise it is worthless.


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
  •