Solved

how to overwrite a font property on <li>

Posted on 2011-02-24
8
341 Views
Last Modified: 2012-06-27
how to overwrite a font property on <li>
I only want <li> to stay the same, not the other text
so h1 is bigger
   
and you cant change this line:
<li><font size="2">I want this font to be 12px</font></li>



reason:
I am working with alot of copy paste text and want the all the fonts to be the same
0
Comment
Question by:rgb192
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 1

Expert Comment

by:pmainardi
ID: 34975783
why can't you change it?
the <font ...  tag is deprecated
anyhow, try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
      <head>
      <title>...</title>
      

      <style>
      /**/
      .test ul {
      font-size:12px;
      color: #cc0000;
      }
      .test li {
      font-size:12px;
      color: #cc0000;
      }
      .test font {
      font-size:12px;
      color: #cc0000;
      }
      </style>      
      </head>
      <body>
      <div class='test'>
      <ul>
      <li><font size="1">I want this font to be 12px</font></li>
      <li><font size="1">I want this font to be 12px</font></li>
      <li style="font-size:12px;">I want this font to be 12px</li>
      </ul>
      </div>
      <ul>
      <li><font size="1">I want this font to be 12px</font></li>
      <li><font size="1">I want this font to be 12px</font></li>
      <li style="font-size:12px;">I want this font to be 12px</li>
      </ul>
      
      </body>
</html>
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34975794
But you have to change that line because the 'font' tag overrides the setting for the 'li'.
0
 
LVL 16

Expert Comment

by:SSupreme
ID: 34975859
This will be enough: font {font-size:12px;}
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:rgb192
ID: 34982637
but how to change h1
0
 
LVL 16

Expert Comment

by:SSupreme
ID: 34983357
h1 {font-size:18px;}
0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 34985212
You're probably not going to get far. The last style the browser sees, wins, so even f you find a selector or hack that works in some browsers it will still just work with some browsers.

Have you considered find and replace? I've used find and replace on massive sites (30,000+ pages) with good results. You should strip out those <font> tags anyway. They're deprecated.
0
 
LVL 16

Expert Comment

by:s8web
ID: 34985410
Make sure you make a backup first. If something goes wrong you can always roll back. I usually make a copy and work on that. When I'm satisfied everything is proper, I swap.
0
 

Author Closing Comment

by:rgb192
ID: 35004005
best solution
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question