Re: Problem with Font control?

  •  07-23-2008, 9:31 AM

    Re: Problem with Font control?

    The effect you are seeing is to do with the web browser "box model".   Assume that a large proportion of page elements (tags) form a "box" around their content.  Clearly there are some tags that do not hold any box content such as the image (img) tag, but essentially all tags form some kind of "box".
     
    Lets take a really simple example of a paragraph (p) or div (div) tag....
     
    <div style="font-family: Comic Sans Ms">
       Here I start in Normal Verdana up to this point -->Changed to Comic Sans Ms
    </div>
     
    As you can see, the "box" is the div tag, and changing the in-line font to Comic Sans simply changes the font of the whole box.  (There is a way round this by highlighting some text and/or using a <span> tag within the <p>, but that's another point).
     
    So, in your example, you hit the carriage return key and the font tured back to Verdana.  I imagine that what probably happned is that there was an outer div around both your text areas that created this issue,....
     
    <div style="font-family: Verdana">
       <div style="font-family: Comic Sans Ms">
          Here I start in Normal Verdana up to this point -->Changed to Comic Sans Ms
       </div>
       <div>
           The row changes back to Verdana...
       </div>
    </div>
     
    You are right in assuming that using a BR tag will solve this because a BR tag does not create a new box...
     
    <div style="font-family: Verdana">
       <div style="font-family: Comic Sans Ms">
          Here I start in Normal Verdana up to this point -->Changed to Comic Sans Ms
          <br/>
          <br/>
           The row stays as Comic Sans...
       </div>
    </div>
     
    I must admit that if try to run two styles in the same "box" using the CuteSoft editor it can get confused as to what you actually means.  
View Complete Thread