varad
varad

Reputation: 8029

html not working for firefox but works for chrome

I have a template :

<font size="2" align="justify"><br/><br/>Some long message</font>

I get justify text in chrome but not in firefox. What might be the solution?

Upvotes: 0

Views: 47

Answers (2)

Alessandro Incarnati
Alessandro Incarnati

Reputation: 7248

Font tag is deprecated in HTML5 but also is always better to separate structure (HTML) and presentation (CSS).

Use a <p> tag (paragraph) for adding long text.

<div>
<p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum  
</p>
</div>

Also the CSS property to justify text is text-align:justify;

div{
    width:500px;
}

p{
    font-size:14px;
    text-align:justify;
}

If you really have to use inline styles, you can:

<p style="text-align:justify; font-size:14px;">

DEMO http://jsfiddle.net/a_incarnati/undmcszz/5/

Upvotes: 2

DrewT
DrewT

Reputation: 5072

The html font tag is deprecated. From w3schools website:

Definition and Usage The <font> tag is not supported in HTML5. Use CSS instead. The <font> tag specifies the font face, font size, and color of text.

Source: http://www.w3schools.com/tags/tag_font.asp

Use a supported HTML structure and style it with CSS:

<p>YOUR TEXT</p>
<style>
    p {
       font-size: 12px;
       text-alignment: justify;
    }
</style>

Upvotes: 0

Related Questions