Advertisement

06.19.2008 at 05:13PM PDT, ID: 23500938 | Points: 500
[x]
Attachment Details

Do i need a DIV or a SPAN for my case?

Asked by paddycobbett in Cascading Style Sheets (CSS), Hypertext Markup Language (HTML)

Tags:

I'm not a css expert, but as i understand the css <span> and <div> tags can be interchangeable by manipulating their css properties. I think that what i need is something between the 2. Correct me if i'm wrong, but div elements appear after after each other (vertically), whilst span elements appear one after the other horizontally (in the space available).

i.e div- display: block;
span- display: inline;

What i need is an INLINE element. Now the problem is that i am using some javascript to highlight the area, for example the following is some text in my page:

<div> or <span>
fsdfsd fdsf fsdf
fdsf  fsd
fdsf fdsf fdsf
sdfsdf
</div> or </div>

I need the area to appear INLINE so i used span. But when i hover over the area only the text is highlighted, when in fact i need the square/block area which encompasses all of the text to be highlighted. I realised that this effect can be caused by <div>, but ofcourse i need the area to be inline. Can i acheive the effect i want by inlining some css to a div or span?Start Free Trial
[+][-]06.19.2008 at 05:46PM PDT, ID: 21827622

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 05:55PM PDT, ID: 21827660

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 06:18PM PDT, ID: 21827759

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 07:23PM PDT, ID: 21828004

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628