Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font-size of a tag using inline css?

Tags:

css

Can't change font-size of a tag for given below code

<td valign="top" width="620"><strong><a href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>

Tried:

<td valign="top" width="620"><strong><a style="font-size:14px;" href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>

Nothing changed;

<td valign="top" width="620"><strong><a class="pub" href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>

a.pub
{
font-size: 14px;
}

No changes;

<td class="pub" valign="top" width="620"><strong><a  href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>

td.pub
{
font-size: 14px;
}

No effects; It is using font of a tag from style.css file I want to change font-size for only this a tag. Any ideas what I am doing wrong?

like image 806
Firdavs Kurbonov Avatar asked Jun 15 '13 08:06

Firdavs Kurbonov


People also ask

How do I change the font size in a tag?

To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.

How do you change the font size in a paragraph in HTML CSS?

To change font size in HTML, use the CSS font-size property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.

Which is used for font size of text in the CSS property sets?

The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length> units, such as em , ex , and so forth.


1 Answers

Strange it doesn't change, as inline styles are most specific, if style sheet has !important declared, it wont over ride, try this and see

<span style="font-size: 11px !important; color: #aaaaaa;">Hello</span>
like image 161
Mr. Alien Avatar answered Sep 28 '22 16:09

Mr. Alien