Monday, December 12, 2011

How do I change font color & font size in HTML?

i would like to use both of them for the same sentence. I tried but my code isnt correct.



%26lt;font size=';-30'; font color=';white';%26gt;weights, workout bench, barbell, olympic, gym, that thing, waffle%26lt;/font%26gt;How do I change font color %26amp; font size in HTML?
%26lt;font%26gt; tags are deprecated; you should consider using instead %26lt;span%26gt; tags, for which you'll need to manipulate css as well. Follow these steps:







1. Write the following in the head section of your html file:

%26lt;link rel=';stylesheet'; type=';text/css'; media=';all'; href=';style.css'; /%26gt;







2. Create a new file called style.css and type the following in it:

span.modified1 { font-size: YOUR_SIZE_HERE; color: YOUR_COLOR_HERE; }



2.1. Replace YOUR_SIZE_HERE with a value such as:

a) xx-small, x-small, small, medium, large, x-large, xx-large (these are absolute, not relative, values)

b) smaller, larger (these values are relative to the parent element's font size)

c) 10px, 25px, 2em, 1cm, 15mm (these are absolute, not relative, values)

d) 90%, 130%, 75% (these values are relative to the parent element's font size)



You cannot use a value like -30 because it doesn't make sense; you have to use an unit together. However, using -30px would still not make sense as there cannot be rendered a text whose size is negative (think of Geometry). If you want a size relative to the parent element's font size then you should use a value from b) or d).



2.2. Replace YOUR_COLOR_HERE with a value such as:

a) aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow (these 16 names are the only ones approved by W3C, an entity that (tries to) standardize web pages)

b) #112233, #668822, #ABCDEF, #29F6A3



If the 16 colors in a) are not enough, you'll have to use HEX colors (in b)), which can be set by typing # and then:

聽聽聽聽聽聽聽聽聽聽I - a two-digit hexadecimal number (that is, the digits can assume the values 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) representing how much red there is in the color. 00 means no red at all, FF means the most red possible.

聽聽聽聽聽聽聽聽聽聽II - similarly as how we did in I, a two-digit hexadecimal number representing green.

聽聽聽聽聽聽聽聽聽聽III - similarly as how we did in I and II, a two-digit hexadecimal number representing blue.



From that you can see that #000000 is pure black, #FFFFFF is pure white, #FF0000 is pure red, and so on.







3. Back to your html file, to apply the attributes you specified for span.modified1 to the text ';Hello World'; write the following:

%26lt;span class=';modified1';%26gt;Hello World%26lt;/span%26gt;







This should be all. I'll be watching this question so if you have any problem just append it to the original question and I'll read it.How do I change font color %26amp; font size in HTML?
alright, idk where u got that but its not correct, you want to use

%26lt;p style=';font-size: 30px; color: white';%26gt;your text%26lt;/p%26gt;



Thats using the most recent styles, you could possibly be using a deprecated style form.
I wouldn't use font tags but ok.



%26lt;font-size=';-30px'; font-color=';#FFFFFF';%26gt;Weights, workout bench, barbell, olympic gym, that things, waffle%26lt;/font%26gt;



-Billy
what size and color would you like your text to be? I design websites
%26lt;font size=';1'; color=';white';%26gt;weights, workout bench, barbell, olympic, gym, that thing, waffle%26lt;/font%26gt;



available font sizes ranges between 1 to 7
By simply changing the sizes and color on the tags you created. Its up to you what will be the sizes and color of the texts you want to change.
Just simply:



%26lt;span style=';font-size: 30px; color: #fff;';%26gt;weights, workout bench, barbell, olympic, gym, that thing, waffle.%26lt;/span%26gt;



Ron
  • find rental properties
  • No comments:

    Post a Comment