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

linked stylesheet strange behavior

Hi,

I have a very simple html that has a linked stylesheet. According to
the style sheet both blocks of text should be displayed in the font
xx-small. but only one (DIV or SPAN) at a time is displayed in this
font and that would be the one that is at the end of the stylesheet
file. for example if DIV selector is the last block in MyStylesheet.css
then the corresponding text in the DIV tag in the html will be small
font. If we swap the spaces of div and span in the styleshet then the
corresponding tag in the span tag in the html will be small
________________________________________________
MyStylesheet.css
/****************/
<style>

span {
font-size : xx-small;
}
div {
font-size : xx-small;
}
</style>

_________________________________________________
Test.htm
<!------------->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="HighResolution.css" />

<title>test.htm</title>

</head>

<body>

<div>this text is in DIV</div>
<span>this text is in SPAN</span>
</body>
</html>

Jul 21 '05 #1
5 2257
In comp.infosystems.www.authoring.stylesheets, aa**********@yahoo.com
wrote:
Hi,

I have a very simple html that has a linked stylesheet. According to
the style sheet both blocks of text should be displayed in the font
xx-small. but only one (DIV or SPAN) at a time is displayed in this
font and that would be the one that is at the end of the stylesheet
file. for example if DIV selector is the last block in MyStylesheet.css
then the corresponding text in the DIV tag in the html will be small
font. If we swap the spaces of div and span in the styleshet then the
corresponding tag in the span tag in the html will be small
________________________________________________
MyStylesheet.css
/****************/
<style>
The above <style> and the </style> must be removed from your
stylesheet. The validator would have told you this.
span {
font-size : xx-small;
}
div {
font-size : xx-small;
}
Consider using percentages instead of keywords for sizing. Some
browsers do not recognize them. For example:
span.small { font-size: 80%; }
</style>

_________________________________________________
Test.htm
<!------------->
You don't want the above line in your HTML.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="HighResolution.css" />

<title>test.htm</title>

</head>

<body>

<div>this text is in DIV</div>
<span>this text is in SPAN</span>
A <span> is an inline element, should not be a child of <body> but
should be within a <div> or a <p> or other block-level element.
</body>
</html>


Post a URL to your problem page.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #2
aa**********@yahoo.com wrote:

div {
font-size : xx-small;

<link rel="stylesheet" type="text/css" href="HighResolution.css" />


I find it rather ironic that you are using such a teensy font-size for a
"high resolution" stylesheet. I take it you don't want your visitors to
be able to read it, eh? ;)

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #3
Hi Beauregard,
...The validator would have told you this. the problem was indeed the <style> tags in the css file. Sorry no
validator ...I am using notepad.
... Some browsers do not recognize them This web app is targetted for an intranet app and our staff use only
one browser type.
...You don't want the above line in your HTML I created this example on the fly. It is a very simple example of a
complex page.
... <span> is an inline element, should not be a child of <body ...

Thanks for shaing this. Is it in w3c specs

Thanks for your help.

Aamir

Jul 21 '05 #4
Thanks for correction. Should have been LowResolution.css

Jul 21 '05 #5
In c.i.w.a.s, aa**********@yahoo.com wrote:
Hi Beauregard,


Good morning.
...The validator would have told you this.


the problem was indeed the <style> tags in the css file. Sorry no
validator ...I am using notepad.


http://www.htmlhelp.com/tools/csscheck/ Copy your file into the
proper text box. Your choice of editor doesn't matter.
... [size words] Some browsers do not recognize them


This web app is targetted for an intranet app and our staff use
only one browser type.


Still ... it pays to use good habits all the time. Oh, in future, be
sure to state if your question is not for www.
...You don't want the above line in your HTML


I created this example on the fly. It is a very simple example of a
complex page.


This is why it is always a good idea to post your problem page on a
server somewhere, so we can see a working example, with some sort of
content.

<sniprest>
--
-bts
-This space intentionally left blank.
Jul 21 '05 #6

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

Similar topics

2
by: Marcus | last post by:
Hello, I recently converted all my existing MyISAM tables to InnoDB tables through phpmyadmin. I noticed some strange behavior whenever I would refresh the screen, as phpmyadmin would report...
4
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
1
by: Mei | last post by:
Hi, I'm running ASP under IIS 6 with Tomcat. During the process, Tomcat will forward to an ASP page with some data and those data will be written to MS SQL and display some information in that...
11
by: Marlene Stebbins | last post by:
Something very strange is going on here. I don't know if it's a C problem or an implementation problem. The program reads data from a file and loads it into two arrays. When xy, x, y, *xlist and...
18
by: genc ymeri | last post by:
Hi, I just noticed that while trying to run this code : MessageBox.Show("Hello"); the message box pops up but shows no string/message in it. (expecting the "Hello" string). Even the "OK"...
2
by: Maileen | last post by:
Hi, I have some strange behavior in my application. Let's say I have 2 buttons and 1 Textbox. 1. when i click on button1, it writes "hello world" in my textbox. i see it. 2. after that, i...
1
by: Alexander Inochkin | last post by:
Hi! I found same strange behavior of ASP.NET. It is possible this is the bug. Follow the steps:
0
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage...
10
by: John Kraft | last post by:
Hello all, I'm experiencing some, imo, strange behavior with the StreamReader object I am using in the code below. Summary is that I am downloading a file from a website and saving it to disk...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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.