Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Bulk Select and Delete Superfluous Font Tags

    I have an old HTML website I did in Dreamweaver MX. There are dozens of font tags on each page. After upgrading to CS3, these are now conflicting to the point where I can no longer specify the preferred font type and size via the HTML fields.

    Being identical, (<font size="2" face="Verdana, Arial, Helvetica, sans-serif">) is there anyway the tags can be seached for, selected in bulk and deleted all at once, page by page?

    Would this in any way potentially disrupt the page structure, apart from ahving all fonts revert to default?

    If not, is there another method that is less painless than deleting each tag individually, or redoing the entire website?

    Afterward, I would apply CSS to the entire site.

    Thank you for any advice.

  • #2
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry folks if that was a repeat thread. I posted similar a few days ago, but could not see it in the thread listings. Please refer me if it appears elsewhere. Thanks.

  • #3
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,974
    Thanks
    15
    Thanked 229 Times in 229 Posts
    There are any number of good and free text highlighting editors that will do a search and replace for you. Scite is available for the Nixes, Mac and Windows too. If you have hundreds of pages you can use 'sed' the Stream Editor, which is command line only, or runs from scripts, but it can automatically search and replace over literally hundreds of pages in a session.

    What I would suggest, having done this myself, is something like this:

    Code:
    Replace this:
    <font size="2" face="Verdana, Arial, Helvetica, sans-serif">stuff here</font>
    with this:
    <span class="f1">stuff here</span>
    Also, when you are doing bulk search and replace, if you have any doubts about wiping out particular blocks of code, just replace the code with a comment tag, you can always remove the comment tag or put the code back.

  • Users who have thanked DrDOS for this post:

    pnielsen (06-15-2012)

  • #4
    New Coder
    Join Date
    Jun 2012
    Posts
    36
    Thanks
    9
    Thanked 1 Time in 1 Post
    You can also use dreamweaver CS6 and notepad++ (which is freeware)

  • #5
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    OK ... but font size discrepancy in Firefox only

    The suggestions so far worked well, and everything looks fine in DW design view and IE. But in Firefox, the paragraph font is enlarged one size throughout the entire page.

    I am unable to find a logical explanation for this. Can anyone please offer one?

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The font tag was removed from HTML in 1997. There are no longer any such thing as font sizes in HTML.

    You should be specifying font sizes via CSS using 1em as the base font size.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •