0

Ok two questions here:

1) What's the best way to set a global text size that would be consistent throughout all browsers? Or will there always be variance? Defining inside the like this?

    html {
        font-size: 1em;
         }

2) If I want something like this as a header at the top of my page:

The Portfolio of John Doe

what's the simplest way to get the first 3 words italic and the name in bold? I tried using a span tag but it was giving me weird sizing issues.

thanks in advance for any help

  • are you sure you want to have the same font-size on all elements? see the answer here for consistent font-size: http://stackoverflow.com/questions/521832/consistent-font-size-across-browsers-web-development – Robin Manoli May 04 '13 at 22:25

2 Answers2

0

1) That is the best way to set the font sizes, If your really concerned about consistency you should check the user agent string to see which browser your in, but that seems like overkill
2) for the second part use the font style property

p.normal {font-style:normal}
p.italic {font-style:italic}
p.oblique {font-style:oblique}
aaronman
  • 18,343
  • 7
  • 63
  • 78
  • ok it's set up in an h1 tag, but I want the first 3 italicized words smaller than the bolded name. so how would I separate those two styles within the same h1 tag? I get the use of the CSS styles, just not sure the best way to go about it. thanks – tdo-design May 04 '13 at 22:53
  • Just wrap them in spans with different ids – aaronman May 04 '13 at 23:19
0

1) Usually these styles are set on the body tag but other than that it's the way it should be done:

body {
    font-size: 1em;
}

2) Why not just use the html tags?

<i>The Portfolio of</i> <b>John Doe</b>
Marcel Gwerder
  • 8,353
  • 5
  • 35
  • 60