473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to omit or over ride a span element

228 100+
I have a round [ all corners] with the following CSS code which i downloaded from the inet:

Expand|Select|Wrap|Line Numbers
  1. div#container {    
  2.             color: black; display:block;
  3.             background: #fff url(sifakaptl.gif) top left no-repeat;
  4.  
  5.         }
  6.  
  7.         div#container  span {
  8.             display: block; /* sets all spans inside p to block, so only need this once */
  9.             background: url(sifakaptr.gif) top right no-repeat;
  10.         }
  11.  
  12.         div#container  span span {
  13.             background: url(sifakapbr.gif) bottom right no-repeat;
  14.         }
  15.  
  16.         div#container  span span span {
  17.             padding: 1em;
  18.             height: 0; /* fixes a padding bug in IE */
  19.             background: url(sifakapbl.gif) bottom left no-repeat;
  20.         }
  21.  
  22.         div#container  span span > span {
  23.             height: auto; /* sets the height back to auto for all other browsers */
  24.         }
  25.  
  26.  
It works fine with the following html code, the div is entirely rounded in four corners:

Expand|Select|Wrap|Line Numbers
  1. <div id="container">
  2. <span><span><span>
  3. web page content goes here
  4. </span></span></span>
  5. </div>
  6.  
Now, the problem is if a span element is found in the Content page, the css code defined for the round element takes effect. I hope i am clear [i am not native english speaker] but i hope you get the idea. how do i solve this issue?
Apr 15 '10 #1
3 2391
drhowarddrfine
7,435 Expert 4TB
You don't show anything for the Content page so it's a guess. I was just reading how the > selector can sometimes be interpreted to affect nearby elements but I don't recall what it was.

Does this happen in all browsers? You could just use border-radius for the rounded corners and problem solved but it only works in modern browsers and not IE.
Apr 15 '10 #2
samvb
228 100+
Yes, it happens in all browsers. is there anyway i can give the span a unique id so that the css styles wouldn't affect any other CSS. and i even removed the line with > selector but nothing changed.
Apr 16 '10 #3
drhowarddrfine
7,435 Expert 4TB
<span id="your_id">

Then, in your css:

#your_id{
your css
}
Apr 16 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
2
by: Mike | last post by:
I´ve got a number of SPAN elements named "mySpan1", "mySpan2", "mySpan3" etc, and want to set their "style.display" to "inline". This works (only needs to work on IE5.5+): for (var x = 1; x <...
14
by: Reply Via News Group Please | last post by:
Folks, I'm new to CSS and realise that by posting in the html newsgroup, I might upset one or two readers by raising a CSS question in an html newsgroup however my ISP only has one small CSS...
12
by: Stan Brown | last post by:
I've been thinking about float-ing a span versus float-ing a div, and the same for absolute positioning. When what is floated or positioned is a short chunk of text, I don't see any _visual_...
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
9
by: developer | last post by:
Does anyone know what is the way IE treats span tags(<span>) and table tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if it placed with other elements that are in a table? Can...
5
by: Richard Lewis Haggard | last post by:
What is the syntax to over ride the array index operator ''? I want to derive a class from CollectionBase and have it encapsulate an array of another class I'm working with. Among other things,...
26
by: johkar | last post by:
I need to cancel the link and execute a function onclick of all the links within the span tag which has a class of "container" assigned. There will be only one span tag with this class applied. ...
3
by: Jason | last post by:
I don't usually use CSS positioning very much, but I thought that I understood the concept until I got into this one. The site is using a mixture of tables and CSS (to make sure it works well on...
14
by: pamelafluente | last post by:
Hi guys, I have a hard problem :) I have the following situation: <span onmouseover = "SelectionEffect()"> <div style="width: 50px; height: 50px; background-color:#FFE4E1"></div> </span>
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.