style setting that div will have the final say and not the skin file

T

Tony Johansson

Hello!

The asp group doesn't seems to know this question so I try here even if this
is not a C# question.

Assume I define a label in the skin file, setting font-size to Smaller in
this way.
<asp:Label BackColor="White" ForeColor="Red" Runat="Server" Font-Bold="True"
Font-Size="Smaller" />

Now I create an inline style on the div tag that look like this.
<div style="font-size: xx-large; font-family: Verdana">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>

When I run this page and look in the show source I can see this for the div
tag that is of interest for me.
<div style="font-size: xx-large; font-family: Verdana">
<span id="Label1"
style="color:Red;background-color:White;font-size:Smaller;font-weight:bold;">
Label
</span>
</div>

In the Browser I can notice that it's the style for the div that will have
the final say.
I would believe that the skin file would have the final say but that was
wrong.

So my question is how is it possible that the div will have the final say
for this font-size ?

//Tony
 
A

andy

Hello!

The asp group doesn't seems to know this question so I try here even if this
is not a C# question.

Assume I define a label in the skin file, setting font-size to Smaller in
this way.
<asp:Label BackColor="White" ForeColor="Red" Runat="Server" Font-Bold="True"
Font-Size="Smaller" />

Now I create an inline style on the div tag that look like this.
<div style="font-size: xx-large; font-family: Verdana">
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>

When I run this page and look in the show source I can see this for the div
tag that is of interest for me.
 <div style="font-size: xx-large; font-family: Verdana">
        <span id="Label1"
style="color:Red;background-color:White;font-size:Smaller;font-weight:bold;­">
              Label
        </span>
  </div>

In the Browser I can notice that it's the style for the div that will have
the final say.
I would believe that the skin file would have the final say but that was
wrong.

So my question is how is it possible that the div will have the final say
for this font-size ?

//Tony

The lowest level wins.
So you might have an app where almost all buttons should be blue but a
rare one red.
You'd set the skin for button to blue and then give the button a red
colour.
 
J

Jeff Johnson

Tony Johansson said:
Hello!

The asp group doesn't seems to know this question so I try here even if
this is not a C# question.

Assume I define a label in the skin file, setting font-size to Smaller in
this way.
<asp:Label BackColor="White" ForeColor="Red" Runat="Server"
Font-Bold="True"
Font-Size="Smaller" />

Now I create an inline style on the div tag that look like this.
<div style="font-size: xx-large; font-family: Verdana">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>

When I run this page and look in the show source I can see this for the
div
tag that is of interest for me.
<div style="font-size: xx-large; font-family: Verdana">
<span id="Label1"
style="color:Red;background-color:White;font-size:Smaller;font-weight:bold;">
Label
</span>
</div>

In the Browser I can notice that it's the style for the div that will have
the final say.
I would believe that the skin file would have the final say but that was
wrong.

So my question is how is it possible that the div will have the final say
for this font-size ?

xx-large is an absolute keyword, whereas smaller is a relative keyword. My
guess is that the font is being set to xx-large from and the div and then
made a bit smaller from the span. So let's say that "normal" text is 12pt,
and xx-large is 24pt. xx-large followed by smaller might be 22pt. If you
were expecting smaller to be based on the 12pt size and produce, say, 11pt
text, then that's where you were mistaken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top