Hello,

So I've done it the old fashioned way with <font size="15">Blah Blah</font> as this is the easiest way I know of at current for doing select bits of text only. However, no matter how high I set the font size, whether it be 10000 or 10 it does not change and simply stays the same. I'm really puzzled by this and it's driving me nuts!

style.css

body {
background-color:#000000;
}

a,a:visited {
    text-decoration: none;
    color: #fff;
}

a:hover {
    color: #ff9000;
}

p {
color: #fff;
}

.welcome {
    width: 950px;
    height: 230px;
    background-color: #141414;
    border-radius: 20px; 
    -moz-border-radius: 20px; 
    -webkit-border-radius: 20px; 
    padding-top: 5px;
    margin-bottom: 20px;
    margin-left: auto;
        margin-right: auto; 
}

.content {
    width: 1020px;
    height: 860px;
    background-color: #282828;
    border-radius: 20px; 
    -moz-border-radius: 20px; 
    -webkit-border-radius: 20px; 
    padding-top: 20px;
    margin-bottom: 20px;
    text-align: center;
        margin-left: auto;
        margin-right: auto;
}

.line {
    padding: 0 20px;
    width: auto;
    margin: 0 auto;
    border-top: 3px solid #212121;
    display: block;
}



#footer {
    background: url(/images/footer.png) repeat-x top center;
    width: 100%;
    padding-top: 120px;
    padding-bottom: 150px;
        position: absolute;
    margin-bottom: 0px;
        margin-right: 15px;
        margin-left: auto
        bottom: 0%;
}


#marq {
border: 1px solid #000000;
background-color: #E65A2C;
width: auto;
height: 18px;
color: #ff9000;
font-size: 14px;
text-transform: uppercase;
font-weight: 700;
}

#marquee {
margin: 0px 0 0px 0;
position: relative;
}

index.php

<?php
$home = true;
$title = 'Home';
include('header.php');
?>

<div class="bg">



        <div class="clear"></div>
        <div class="grid_12" id="content">
            <div class="content-spacer">
  <br > <br >


<div class="content">

    <div class="welcome"> 
        <font face="Skranji" size="150px">
        <font color="#ff9000">LATEST</font> 
        <font color="#ffffff">NEWS</font></font>
        <div class="line"> </div>
 <p>test ... test
    </div>


    </div>

<?php
include('footer.php');
?>
</div>

Dani AI

Generated

two things are tripping you up here. First, <font> is obsolete, so browsers only keep minimal, legacy support. Second, even back when it was used, size never took CSS units like px; it only accepted integers 1..7 (or relative values like +2). So size="150px" is invalid and the browser falls back to its default size. and are right: move the styling to CSS and target an element you control.

If that "LATEST NEWS" line is a visual headline, give it semantic markup and a class, then style it responsively. Example:

<h2 class="hero-title">
  <span class="primary">LATEST</span> <span class="secondary">NEWS</span>
</h2>
.hero-title {
  font-family: "Skranji", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  line-height: 0.9;
  font-size: clamp(3rem, 8vw, 9rem);
}
.hero-title .primary { color: #ff9000; }
.hero-title .secondary { color: #fff; }

A few quick checks and tips:

  • Make sure the Skranji font actually loads (via @font-face or a font service); otherwise you will see a fallback font.
  • Inspect the element in DevTools and look at Computed > font-size to confirm the final value and spot any overrides.
  • Avoid !important (as suggested by ) unless you are breaking a specificity deadlock; instead, scope your selector (e.g., .content .hero-title) or refactor conflicting rules.
  • Consider removing fixed heights on containers like .content; large type can overflow if the box is rigid.

Recommended Answers

All 4 Replies

<font> has been deprecated since HTML 4.01. Don't use it. Also, I don't think the old SIZE attribute accepts "px".
Use <span> instead, and if you must add styling on a per-item basis, add inline styles:

<span style="font-size: 150px;">text</span>

, so you got to this one before me...haha.

Yeah, I wouldnt recommend the use of font either at this time. While modern browsers still support it, since its been deprecated, future verions of modern browsers could decide to drop it. Whenever you want to style an object, its best to use CSS. The span element is more appropriate. Of course, if you have to apply this style to many other span elements, create a class for it and apply the class to the element.

For example...

In your style sheet..

.bigFont {font-size:150px;}

In your HTML

<span class="bigFont">Text1</span>
<span class="bigFont">Text2</span>

This way, if you ever change the font-size from 150px say to 100px, you only make the change in your style sheet.

Sweet! That makes it so much nicer and easier to code with now!

if u're stuck in css
give the span id or class (Wrapping u're desired text)
give the css like this

font-size : 19px !important;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.