Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to overwrite a font property on <li>

Posted on 2011-02-24
8
Medium Priority
?
346 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 84

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Suggested Courses

971 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