a method of psychological evaluation

Search
Categories
  • About Me
  • Contact Me
  • Links

Float images within Wordpress

When an image sits on the sides of your text, it helps to have space between the text and the image so the words aren’t right up against the edge. As some browsers treat the margins and padding differently, the following styles will accommodate most browser’s “space requirements” so the image doesn’t overlap the text or any lists that appear inline with the image.

Float image Left and Right

img.right { padding: 4px; margin: 0 0 2px 7px; display: inline; } img.left { padding: 4px; margin: 0 7px 2px 0; display: inline; }

The declaration of display:inline keeps the image inline with the text that you placed it with.

Now, it is time to add the float declaration to the images. BUT WAIT. Why should we waste our left and right floats on just images? Why not use them on anything that we want to sit on the right or left of the page and have the text float around it? You can do that, you know. But that’s for another tutorial. We’re not going to waste this, so if it isn’t there in your style sheet already, add the following:

.right { float: right; } .left { float: left; }

Clear The Display

In the event the image is larger than the amount of text that would otherwise surround it, causing the image to hang like a flag over some element below it, then at some point in the text, you’ll want to clear the display. Note that there is no text inside this division.

<div style="clear:both;"></div>

Share and Enjoy:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • De.lirio.us
  • Netscape
  • Reddit
  • Technorati
  • YahooMyWeb
  • BlinkList
  • Furl
  • Ma.gnolia
  • StumbleUpon
This entry was written by A2daK and posted on 26 June 2007 at 3:15 and filed under Design. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

    Tag Cloud

      No tags were found that match the criteria given.

    Listening to...

    1. Z
    2. Friend And Foe
    3. Lucky
    4. One Time Bells
    5. With Love and Squalor
    6. Box of Secrets
  • Recent Comments:

    • Unknown: the tin! All the code in a FLUID layout and with RELATIVE text. Its also XHTML and CSS valid...
    • A2daK: I saw a program on TV last night where a young french girl was treated with medication to help her with Post...
    • Alex: So will people like myself be allowed to take these tablets? My heartaches in so many ways that I didn’t...
    • photoshop 7 install on windows vista: Nice points……
    • site: exellent…
  • About this website

    By now you might be thinking is this some sort of mental institute but the theme of this design comes from the name Kleck which translates as "inkblot" in Swiss and was also the nickname of the chap who invented inkblot's and their use in psychological testing His name was Hermann Rorshach

    My logo was originally adapted from Tracey Hall's Text to Inkblot Generator. I found this while researching inkblots. It converts any text into a postscript file inkblot that can then be converted into .pdf. To view my logo at conception follow these quick and simple steps or skip the list and download the pdf at the bottom.

    1. Go to the Inkblot Generator website and type "kleck" and hit create
    2. Next, download the post script file. (.ps) to your desktop
    3. Now use ps2pdf.com to convert the .ps file to pdf
    4. Finally, open the .pdf

    Thats my logo on day 1. At least is has some meaning. If you are lazy like me then click here to see the original pdf!

WordPress | Kleck
  • Valid XHTML 1.0!
  • Valid CSS