Solved

how to overwrite a font property on <li>

Posted on 2011-02-24
8
340 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FIELDSETs and LEGENDs in email markup 1 23
Wrapper for APPs 9 76
Problem to refer to value 8 45
Changing alignment and creating border 6 27
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now