Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to avoid a new line after an image while using styles

Reply
Thread Tools

How to avoid a new line after an image while using styles

 
 
Stefan Mueller
Guest
Posts: n/a
 
      03-09-2006
If I use
<img src = "pic.gif"> Text
the word 'Text' is located on the right side of the image 'pic.gif'.

However, if I use
<img src = "pic.gif"><div class = "my_style"> Text</div>
the word 'Text' is not located on the right side of the image 'pic.gif'.
It's located on a new line.

I guess I need to use <div...></div> because I'd like to set a style (font,
size, weight, color, margins, ...) to the word 'Text'.

How can I set a style to the word 'Text' so that the word 'Text' is still
located on the right side of the image 'pic.gif'?
Stefan


 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      03-09-2006
Deciding to do something for the good of humanity, Stefan Mueller
<(E-Mail Removed)> declared in alt.html:

> However, if I use
> <img src = "pic.gif"><div class = "my_style"> Text</div>
> the word 'Text' is not located on the right side of the image 'pic.gif'.
> It's located on a new line.


That's because <div> is a block-level element.

> How can I set a style to the word 'Text' so that the word 'Text' is still
> located on the right side of the image 'pic.gif'?


Replace div with span.

--
Mark Parnell

Now implementing http://blinkynet.net/comp/uip5.html
 
Reply With Quote
 
 
 
 
Stefan Mueller
Guest
Posts: n/a
 
      03-09-2006
> Replace div with span.

Great, that works.

Many thanks
Stefan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with design - reload image on image load; avoid infinite loop lawpoop Javascript 17 06-22-2009 06:59 PM
how to avoid line return when using python -c 'print "foo"' TP Python 1 07-18-2008 09:15 PM
Avoid having a SQL express for web parts and avoid personalization Roger23 ASP .Net 2 10-12-2006 10:54 PM
Avoid wasting time or how to avoid initialization Alexander Malkis C++ 8 04-13-2004 11:23 PM
Styles missing after upgrade Phil S. ASP .Net 0 07-08-2003 08:17 AM



Advertisments