Solved

how to overwrite a font property on <li>

Posted on 2011-02-24
8
338 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 82

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
 

Author Comment

by:rgb192
ID: 34982637
but how to change h1
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
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…

743 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

11 Experts available now in Live!

Get 1:1 Help Now