473,387 Members | 1,863 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,387 software developers and data experts.

span problem

Sorry to bother you; in the below test, <SPAN> doesn't do the text
alignment. What's wrong? Using Opera 7.50 for Windows.

<HTML>
<HEAD>
</HEAD>

<BODY>

<P>regular text
<span style="text-align:center">text-to-center</span>
</p>

<!--
It didn't center the text-to-center
-->

<P style="text-align:center">
text-to-center
</p>

</body>
</HTML>

--
Sheldon Isaac
lose all .control when replying
Jul 20 '05 #1
3 14963
Shel <si************@netaccess.control.com> writes:
Sorry to bother you; in the below test, <SPAN> doesn't do the text
alignment. What's wrong? Using Opera 7.50 for Windows.
text-align only applies to block elements - span is not a block element.
<P>regular text
<span style="text-align:center">text-to-center</span>
</p>


Options:
<p>regular text</p>
<p style='text-align: center'>text-to-center</p>

or

<p>regular text
<span style='text-align: center; display: block;'>text-to-center</span>
</p>

depending on whether the text being centred is logically part of that
paragraph (2nd option) or not (1st option, probably more likely in
most cases)

--
Chris
Jul 20 '05 #2
Shel wrote:
Sorry to bother you; in the below test, <SPAN> doesn't do the text
alignment. What's wrong? Using Opera 7.50 for Windows.

<P>regular text
<span style="text-align:center">text-to-center</span>
</p>

<!--
It didn't center the text-to-center
-->


Spans are inline elements, try a block level element like a div.

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #3
Chris Morris <c.********@durham.ac.uk> wrote:
text-align only applies to block elements - span is not a block element. <p>regular text</p>
<p style='text-align: center'>text-to-center</p>

or

<p>regular text
<span style='text-align: center; display: block;'>text-to-center</span>
</p>

depending on whether the text being centred is logically part of that
paragraph (2nd option) or not (1st option, probably more likely in
most cases)


Thank you very much!

It was the "first option" situation

--
Sheldon Isaac
lose all .control when replying
Jul 20 '05 #4

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

Similar topics

1
by: gadi | last post by:
Hi. i need help. i can`t use xsl to transform an xml to html using asp.net. when the xml and the xsl are in english it works fine. the problem began when the xml ans xsl have words in...
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
2
by: reproots | last post by:
hi there, i am having trouble with a span command and would like to know if someone can help me, or point me in the correct direction. basically, i want a little textbox to pop up when a mouse...
4
by: coldflame | last post by:
Hi I am facing a problem with row span the code is given below. problem is that when i the contents of the right panel increased the first cell dat have menu get unnessary space , i did't know...
0
by: jesmi | last post by:
hello my code is <span id="GrandTotal"></span> i want to take the value of this id="GrandTotal" in next page from .jsp. can't i take its value in next page from request.getParameter or not?...
2
by: Ravi Joshi | last post by:
The menu on my site works fine in IE6 and Firefox. In IE7, there is a problem with the menu: when you mouse over the various main catagories, the sub-catagories all appear to the right as they...
1
by: kchaitanya | last post by:
I have created a master page. When I am adding this master page to .aspx files which are in the root directory, it is working fine. When , I am adding master page to .aspx files which are in sub...
1
by: abranches | last post by:
Hello everyone. I'm having a problem when extracting data from HTML with regular expressions. This is the source code: You are ready in the next<br /><span id="counter_jt_minutes"...
2
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.