homepage Welcome to WebmasterWorld Guest from 54.197.65.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
using video image in links
OldWolf

5+ Year Member



 
Msg#: 3200134 posted 7:17 pm on Dec 26, 2006 (gmt 0)

Hi

Im trying to put an image before or after a link to give my visitors the idea what is about, example yahoo, left column services.

My css
.ex{
background-image: url(images/ex.gif );
background-position: left;
background-repeat: no-repeat;
padding-left: 5px;}

my html
<div class="ex" title=""><a href="red-widgets/">Red widgets</a></div>

My problem is when i use it in the middle of a sentence it goes the next line after i close div instead keep going on same line

 

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3200134 posted 9:44 pm on Dec 26, 2006 (gmt 0)

Add:

white-space: nowrap;

:-)

OldWolf

5+ Year Member



 
Msg#: 3200134 posted 11:39 pm on Dec 26, 2006 (gmt 0)

Thanks rock but didnt work :(

i cant edit my post but my example should look like this
Some text<div class="ex" title=""><a href="red-widgets/">Red widgets</a></div>some text.

Thanks

encyclo

WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3200134 posted 1:32 am on Dec 27, 2006 (gmt 0)

A
div is a block-level element, so the browser is behaving correctly in this instance. If you want to have this occur inline, then you must use an inline-element such as a span, for example:

Some text<[b]span[/b] class="ex" title=""><a href="red-widgets/">Red widgets</a><[b]/span[/b]>some text.

Of course, it may not be necessary to add the extra span at all - have you tried applying the styles directly to the anchor itself?

Some text <a [b]class="ex"[/b] href="red-widgets/">Red widgets</a> some text.

OldWolf

5+ Year Member



 
Msg#: 3200134 posted 11:51 am on Dec 27, 2006 (gmt 0)


I tried this and it worked

<a class="ex" href="red-widgets/">Red widgets</a>

Thank you encyclo

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved