473,808 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to omit or over ride a span element

228 New Member
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 2409
drhowarddrfine
7,435 Recognized Expert Expert
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 New Member
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 Recognized Expert Expert
<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
3407
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 <foo/>) From XHTML specification:
2
6038
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 < 20; x++) { document.all('mySpan'+x).style.display = "inline"; } But I don´t know how many SPAN elements there are, so I need to set x to a
14
11003
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 newsgroup available - I'm hoping someone here might be able to help. I have an external style sheet which I call/install from inside my head tags like so:
12
10947
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_ difference between the two. What I want to do is float (or position) a revision date at the right margin of a line that also has some text left justified. I tried earlier to do this and failed utterly in MSIE 4. But I was using span not div, and...
9
6848
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 the the span element when I select the whole text in the SPAN and drag it. However, I want to drag it without have to select the words between the span element. The default mouse action will only select the words when i move the mouse. Can...
9
7170
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 the span tag itself contain table tags within it? I have some scripting code and when I wrap the span in table elements it does not find the html within the span. Here is an example.... <tr><td colspan="4" align="left"><span...
5
9949
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, it needs to over ride the operator but I don't seem to be able to get the syntax quite right. Can someone tell me what the syntax should be in order to over ride the operator? -- Richard Lewis Haggard
26
8128
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. I know you can get a specific tag using document.getElementsByTagName('span'), but I am unsure how to get the one with the class="container". I know there is a getAttribute method, just need a pointer or two to put it all together. Once I know...
3
2318
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 older browsers; CSS is mainly used for fine-tuning), and I'm trying to get an image to overlap a table. The main table is centered on the screen, though. Here's the simplified layout that I'm using:
14
2996
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
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10631
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.