Problem with Font control?

Last post 07-23-2008, 9:31 AM by MarkMyWords. 1 replies.
Sort Posts: Previous Next
  •  07-19-2008, 1:56 PM 42369

    Problem with Font control?

    Here I start in Normal Verdana up to this point -->Changed to Comic Sans MS. Of course, the whole prior typing also changed and that bug has been reported. The other problem now is when I press Enter:
     
    The row changes back to Verdana...
     
    I guess to make it the same font continually I should set the BreakElement to BR? If so, what's the difference between BR and DIV?
     
    Thanks, Adam
  •  07-23-2008, 9:31 AM 42471 in reply to 42369

    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 as RSS news feed in XML