General HTML/Web Design Programming Q`s/HTML and CSS
I use this code to set Text Style
<P style="font-family:times new roman font-size:100%;">
But if I did the basic
<P font family="times new roman" font size="100%">
Would this not work?
I am going so nuts with every time the CODEs change. I am just getting more and more mixed up.
Thanks for the help?
You must indicate the font-family property:
font-family: "Times New Roman", Times, serif;
Use the (:) and not the (style =)
I would also set the font size in (px) value or (em) value but that is a personal choice. You may use a combination of Percentage and Em:
Furthermore, I do not recommand the use of CSS within a selector. It makes no sense to add styling to each and every HTML selector. For example all the P selectors would have to be styled individually.
The first rule of coding is to separate content (HTML) and style (CSS).
You can place the style in the Head section or in a separate expernal style sheet. I would recommand the external style sheet (I sometimes use the head section then copy and paste the CSS code in an external style sheet).
There are three ways of inserting a style sheet:
External style sheet
Internal style sheet
1. With an external style sheet, you can change the look of an entire website by changing just one file! Changing any selector in a single operation (e.g. all the paragraphs)
2. An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of an HTML page:
3. An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>
I Hope this help. If not go to http://www.w3schools.com/css/css_font.asp
. It has all updated informations for ALL web design codes.