1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

CSS css for width height align

Discussion in 'Web Development' started by navyfalcon, Dec 17, 2011.

  1. navyfalcon

    navyfalcon Well-Known Member Verified Member

    How would I use inline CSS to set the atributes on this

    <a href="../Reference1/Virtual%20TI%20Emulator.html" width="100" height="20" align="right" alt="TI emulator"><strong><font size=
    "+1">Free TI Emulator for PC</font></strong></a>

    Thank You
    falcon
     
  2. Geoff Tyrer

    Geoff Tyrer Member

    Inline and block elements

    <a> is an inline element and you cannot apply width or height to it.

    You have to make it a block element by applying display:block;

    Code:
    <a href="../Reference1/Virtual%20TI%20Emulator.html"  style="display:block;width:300px; height:200px; text-align:right;"  alt="TI emulator"><strong><font size=
    "+1">Free TI Emulator for PC</font></strong></a>
    See "Pro CSS and HTML Design Patterns" by Michael Bowers for and excellent analysis of the CSS Box Model.
     
  3. navyfalcon

    navyfalcon Well-Known Member Verified Member

    Thank You Geoff Tyrer
    I copied it and put in the web page
    Changed width to 450 and height to 20
    Worked in Firefox with no problems
    now need to check in other browsers
    -
    falcon
     
  4. Geoff Tyrer

    Geoff Tyrer Member

    Hi falcon,

    Please let me know if you hit any problems in the other browsers.

    Geoff