473,387 Members | 1,904 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.

Center one span inside another - Redux

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;
top:310px;
height:53px;
width:185px;
background-color:#800000;">
<span style="font-family:'MS Sans Serif';
font-size:8px;
vertical-align: middle;
line-height: 53px;">
Panel
</span>
</span>
</body>
</html>

But this doesn't:

<html>
<head>
<title>Page 1</title>
</head>
<style>
Panel1 {
background-color:#800000;
font-family:'MS Sans Serif';
font-size:8px;
position:absolute;
left:14px;
top:310px;
width:185px;
height:53px;
text-align: center;
border:thin inset;
}

Panel1Label {
line-height:53px;
}

body {
background:#C2BFA5;
}
</style>
<body>
<span class="Panel1">
</span>
<span class="Panel1Label">Panel1</span>
</body>
</html>
Jul 21 '05 #1
2 1889
Hello Mr. Clean,

Mr. Clean wrote:
<style>
Panel1 {
background-color:#800000;
font-family:'MS Sans Serif';
font-size:8px;
position:absolute;
left:14px;
top:310px;
width:185px;
height:53px;
text-align: center;
border:thin inset;


Wrong syntax.
If you want to use "Panel1" as a class, define it like this:
..Panel1{
....
}
- you forgot the leading point.

Next time, we'd appreciate, if
* you posted your example to an online webpage, and
* you ran a validator on it to spot the most obvious errors.

HTH,
Alex

PS: In addition, your second example - the not working one - did not
nest the spans, as the first example did...
Jul 21 '05 #2
<SNIP>
Wrong syntax.
If you want to use "Panel1" as a class, define it like this:
.Panel1{
...
}
- you forgot the leading point.

Next time, we'd appreciate, if
* you posted your example to an online webpage, and
* you ran a validator on it to spot the most obvious errors.

HTH,
Alex

PS: In addition, your second example - the not working one - did not
nest the spans, as the first example did...


Not withstanding the admonishment, oh Guru, thank you.
Jul 21 '05 #3

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

Similar topics

13
by: MrBaseball34 | last post by:
In this HTML: <html> <head> <title>Page 1</title> </head> <body style="background:#C2BFA5;"> <span style="background-color:#F9DFB2; position: absolute; border:thin inset;
3
by: Charles Crume | last post by:
Hello; I'm fairly new to CSS, but have learned that Mozilla is supposed to be the most compliant in rendering. I have a web page that uses a style sheet with a class named "page_links" that...
2
by: sylvian stone | last post by:
Hi, I'm trying to do something that has always been easy with tables - namely use a three column layout, and above the main layout, show three images - one on the absolute left, one on the absolute...
0
by: PayPal | last post by:
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <STYLE type=text/css> ..dummy {} BODY, TD {font-family:...
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...
1
by: Aitham alama | last post by:
How can i make a dynamically created web label control to to be Center allignment Thanks
10
by: shapper | last post by:
Hello, I have two div's: <div class="container"> <div class="message">message</div> </div> I need to center the div "message" inside the div "container". But I also want the div "message"...
2
by: donovan | last post by:
OK, so I know that there has been a lot of discussion on this topic, but none of the answers have been satisfactory. Therefore there seems to be only one thing to do: issue a challenge to all of...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...

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.