You are here: Technology, Web & Business Forum
: Web Development
: Design
:
How to align text next to a picture using CSS?
|
Welcome to the Technology, Web & Business Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Design Talk about web design techniques and ideas in CSS, HTML, etc.
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
|||
This is the code I am using:
font, img{align:left; vertical-align:top;} It works, but for only one text line. You can see what I mean here: http://www.neopets.com/~suxaona I want the Age: Guild Job: Hobby: and Comment: to be aligned with the avatar. How would I do this using CSS? Also I need the code to work to in both FF and IE. Thank you in advance. ![]()
__________________
Powered by Yahoo! Answers |
|
|||
|
|||
you can use
img { position:relative; float:left; } note: img affects all images use img.image1 instead <img src="image_source" class="image1" /> makes the image stick to the left while "pushing" the text around it, just like in newspapers. then format the text as you like position:relative; is needed to avoid lots of bugs the image will then float on the left with the text on the right you can separate the text bits with the "break tag" br /> (yahoo does not let me type the tags) (note: add the image within the text to avoid some common errors) example: <p><img src="#" />name"break"age"break" hobby"break"</p> replace "break" with proper code <' br '/> possible bug: situation: you have text and images inside a container box wich has automatic height, if the image is floating and there is little text then the image will overflow the box. if you have automatic height for the "text container" add a div at the bottom and assign it "display:block; overlow:hidden height:1%;" this will move the bottom of the text container lower which will now move or you can <img src=”images/sample.jpg” height=”100” width=”75” align=”left” alt=”My Sample Image” /> align can have a value of left, right, and center P.S. nice looking site by the way
__________________
Powered by Yahoo! Answers |




Linear Mode
