473,804 Members | 3,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

span style

I have a problem with css
I have a this xhtml code:
<span>
<span>
<span/>
<input type="radio"/>
....
<span/>
<input type="button" onclick ="var s=document.crea teElement('span ');
this.previousSi bling.firstChil d.appendChild(s ); "/>
the first span is display:block
the second span is display:inline
the thirdth span is display:inline and have a background-image;

I want that when the button is pressed, the image appears without shift
left the radio button and the rest of elements(...).
I had tried by setting the width property of the second span but it
don't work. It should work in firefox and IE. Someone can help me
please?
thanks

Dec 12 '05 #1
5 3255
st**********@ti scali.it wrote:
I have a problem with css
I have a this xhtml code:
<span>
<span>
<span/>
<input type="radio"/>
....
<span/>


Invalid HTML, correct the errors.

--
Spartanicus
Dec 12 '05 #2
<span>
<span>
</span>
<input type="radio"/>
....
</span>

Dec 12 '05 #3
st**********@ti scali.it wrote:
<span>
<span>
</span>
<input type="radio"/>
....
</span>


http://diveintomark.org/archives/200..._wont_help_you
http://www.spartanicus.utvinternet.i...s_help_you.htm

--
Spartanicus
Dec 12 '05 #4
You cannont set the width of the second span because it is an inline
element. That's not valid.

Also, if the first span is block, then why not make it a div (which is
block automatically)?

Taking a guess at what you are trying to do... I would make the second
span a div (block element) and float it aside of what you want with a
set width.

Fix your code and post an example of your somewhere where everyone here
can look at it. Then we will be able to better help.

Adam

Dec 12 '05 #5
I'm sorry but I can't speeck and understand english very well.
All the xhtml code of my page came from an xml file with xsl
trasformation (<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="layout.xs l" type="text/xsl"?>.......) .
I can obtain this xhtml code:
.....
<span>
<input type='radio' class='radio' />
<span>1</span> <!-- the number of choice-->
<span>some text</span> <!-- the content of choice-->
</span>
<input type='button' onclick='javasc ript code...;' />
.....
The radio-button, the number and the content should be in the same line
so I had set the display:inline property for theese elements.
when the button is clicked an arrow image( with click event for open a
new window with new content) should appears at the left of the
radio-button,in the same line, and the content of the line should not
move to the right when the image is visualized.
To do so it need to reserve a space for the image before the radio and
the rest of the line but I have some problems...

I tried in this way:
<span>
<span>
</span> <!--new span-->
<input type='radio' class='radio' />
<span>1</span> <!-- the number of choice-->
<span>some text</span> <!-- the content of choice-->
</span>
<input type='button' onclick='javasc ript code...;' />
when the button is pressed is created the onclick attribute for the new
span and is applied the background-image property (I can't use a anchor
tag with href attribute for js code because in this code I must have a
reference to the element that is clicked. With span and onclick
otherwise I can call a function in the way that follow:
"exampleFunctio n(this);".)
In this way the problem is that if the new span is display:inline the
content of the line(radio, number and content) move to the right when
the button is pressed( I can't use the width property), and if the new
span is display:block the conten of the line apperars in a new line.

How can I solve this prolem?
thanks

Dec 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1937
by: David Henderson | last post by:
Hi There... I'm struggling with a problem: I have a string (coming from a rich text editor) which contains a variety of span tags that need to be replaced with corresponding formatting tags. e.g. <span style="font-weight: bold;">line 2</span> needs to become
2
6037
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
23
4095
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:
3
5519
by: macgyver | last post by:
This is a strange question, and I think the answer is NO, but I am asking anyway. I am a member of a website which allows us to alter our member profiles. Using css in the middle of the profile area allows one to overide the normal formatting of the entire page and truly customize it. But there is a span-style tag which gives an ugly blue background to certain text which I want to get rid of. This is the tag: <span...
2
1934
by: Mr. Clean | last post by:
Why would this work: <html> <head> <title>Page 1</title> </head> <body style="background:#C2BFA5;"> <span style="text-align: center; border:thin inset; position:absolute; left:14px;
27
4756
by: Nicholas Couch | last post by:
I have a little form with a couple of dynamically generated list boxes. When the user makes a selection from the first box, the second box is refreshed. When they make a selection from the second box, I concatenate the selections from the two boxes and add the string to a list at the top of the form, using createElement and appendChild. The list is actually a bunch of span elements contained within a div. Each span element includes a small...
6
2836
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down and adjust to the newly added items like it does in iE. It just occured to me that i dont really have to use a span, and a html <hr> tag could do the trick -I will go try. But aside from that could some one explain why this occurs? And will I get...
4
23474
by: jawolter | last post by:
I have text that is too long to nicely fit on a given page, so I want to add ellipses to the end that dynamicaly resize based on the person resizing the page width. If you hover it would show the full text, using a title attribute I believe. It works for a div, but not a span... any ideas? Here's a snippet that I'm working on: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
3953
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems there's no support for this. Either that or I'm doing something wrong. Well, enough venting, here's what I need. Using this sample XML file (test.xml):
7
2346
by: mavigozler | last post by:
IE7 does not appear to set an event on contained text inside SPAN elements whose 'onclick', 'onmouseover', and 'onmouseout' events, defying the HTML recommendation. Firefox appears to conform. Is that so?
0
9705
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
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10568
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
10323
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...
0
6847
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
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
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.