CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Post CSS code affecting my whole web page

    I am learning HTML and CSS. My website is a template that I have collapsed and putting in my own code. I have constructed a sidebar with hyperlinks and it works great; however, this sidebar has the potential to ffect the entire web page. I changed my weather channel banner to the standard look -- instead of seasonal -- because with the CSS sidebar, the text and formatting inflatted in the weather code. This morning I went to install an AdSense ad and the formatting for that was affected as well. I think I need to apply a table or an identifier to my sidebar code, but I don't know how to do it. Any help would be appreciated. --Kemis

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: CSS code affecting my whole web page

    The kind of code you posted looks like spam or advertising, so the HTML code was removed. Please post smaller pieces and if possible without links that will determine us to remove them.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Mar 2011
    Posts
    1

    Re: CSS code affecting my whole web page

    Okay, sorry about that. Here is the top and bottom of my sidebar code. I have only taken out the hyperlinks.

    Code:
    <HTML>
    <table><table id="teemenu">
    <table border="0" bordercolor="0" width="240" bgcolor="f4f7f8"><tr><td>
    
    <style type="text/css">
    a {font-family:arial;font-size:10pt;cursor: auto}
    a:link {color:#0174DF;text-decoration: none}
    a:visited {color: #4B088A;}
    a:hover {text-decoration: none; color: #FF0000; font-weight:regular;}
    a:active {color: #ff0000;text-decoration: none}
    </style>
    
    		<!--LOCAL NEWS-->
    <style>.text { border-bottom: solid #d8d8d8 1px; }
    </style><span style="font-size: 11pt"><strong><font face="arial"><font color=#6E6E6E><span class="text">Top Stories&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</strong></span>
    
    <!--THIS IS WHERE I LIST MY HYPERLINKS-->
    
    </td></tr></table>
    </HTML>
    Last edited by PeejAvery; April 18th, 2011 at 01:27 PM. Reason: Added code tags

  4. #4
    Join Date
    Apr 2011
    Posts
    18

    Re: CSS code affecting my whole web page

    Of course there will be errors in your code and you should check this through the compatibility software of browsers then you can get all of the errors.

  5. #5

    Re: CSS code affecting my whole web page

    I can't see the problem from your markup but one approach I tend to use it that of classes. So for example:

    Code:
    <div class="generaltext">mytext</div>
    In my CSS is can simply refer to:

    Code:
    div.generaltext { ... }
    This strict method of keeping track of the HTML elements I'm using and how I've styled them helps me avoid accidentally modifying the styling for something inadvertently.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured