Solved

how to overwrite a font property on <li>

Posted on 2011-02-24
8
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
Suggested Courses

617 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