1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Any CSS/HTML experts here?

Discussion in 'General Discussions' started by wildfire, 2009/01/31.

  1. 2009/01/31
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    I've just started creating my own site and would like to keep it as simple as possible (ie no multimedia, no javascript etc).

    The last time I done this was a few years ago and I used tables for layout, I'm now trying CSS but have a few problems.

    Layout and cross browser are the main ones, the site looks totally different in IE and FF so who knows what other browsers show.

    Anyway, the site is still very bare but if someone would like to take a look and give advice it would be appreciated.

    http://www.yaawns.myby.co.uk/
     
  2. 2009/01/31
    Rockster2U

    Rockster2U Geek Member

    Joined:
    2002/04/01
    Messages:
    3,181
    Likes Received:
    9
    I assume Zaluska plays soccer ...urh....... uhh football? What you've got up looks fine but you might want to consider a brighter color - it only lights up my office and part of the backyard.

    Looks good ...
    Regards,
    ;)
     

  3. to hide this advert.

  4. 2009/01/31
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Erm, United play in tangerine :rolleyes:

    Seriously though, it's the layout that's the problem.

    In IE the menu highlight doesn't reach to the right side border but with FF it's OK.

    In FF once the content reaches the bottom it messes with the footer (check the blog) but with IE that's OK.

    The dates in the blog, In Out and Rumours page should be bold and underlined, In FF they're underlined but in IE they're not and neither show them bold.

    Any advice?
     
  5. 2009/01/31
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    More information

    Idealy I would like the menu to float down as the page scrolls down (some of these pages could grow quite large). I'd also like the header and footer to be fixed (the header isn't that important though) and the content should be similar cross browser.

    I'm beginning to think that I can't squeeze anymore into this skull of mine and if this was done using BBC BASIC or Pascal then it's not a problem, even using tables wasn't so much of an issue 5 years ago but I've been told that's a bad thing nowadays.

    Will someone assist a decrepit old man? :(
     
  6. 2009/01/31
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    To have the footer unaffected by the left & right DIVs, add this style to the footer DIV:
    clear:both;

    To have the menu move up & down as the page is scrolled you will need to use javascript.

    The CSS you are using has incorrect styles for your div margins.

    Here's a simple guide for a css layout without tables.
     
  7. 2009/02/01
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Change this:
    Code:
    #content {
    left:300px; */ is not a style, by itself does nothing */
    width: 100%;
    height: 80%;
    } 
    to this:
    Code:
    #content {
    text-align:center; */ don't use the <center> tag, it's depreciated. */
    margin-left:300px;
    width: 100%;
    height: 80%;
    }
     
  8. 2009/02/01
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Thanks Tony,

    I'm working on it :) and your previous link helped a lot.

    As far as adding center to #content though it's only the main page that will be centered. Is it preferable to create a new style for this or stick to the <center> tags?
     
  9. 2009/02/02
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Don't use the <center> tag at all.
    The default alignment is always "left" even if not specified. Thus, on the pages that require centered content do this:

    <div id= "content" style= "text-align:center; ">

    to override the alignment used in the .css file.
     
    Last edited: 2009/02/02
  10. 2009/02/02
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Gotcha, it's starting to look better now ;)

    A couple of other problems though...

    1) I would like to remove the tangerine border that appears around the header and footer (the footer isn't that important though).

    2) The menu still isn't right with IE, with FF the Darker orange background for current selection and the lighter orange for hovering reaches right to the end of the spacer lines if you see what I mean. With IE the colour changes don't reach (I think it's related to the GIF arrow I used as the shortfall looks about the same width).

    Any ideas, and your help is appreciated.
     
  11. 2009/02/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    I don't see any border around the header & footer.
    If you want the header & footer to scale to edge of window then change this:
    Code:
    body {
    color: #000000;
    background-color:#F95602;
    margin: 0px;
    padding: 20px;}
    
    to this:
    Code:
    body {
    color: #000000;
    background-color:#F95602;
    margin: 0px;
    padding: 0px;}
    
    then do this:
    Code:
    #menu {
    float: left;
    margin-left: 20px; */ indent 20px; */
    width: 200px;
    height: 80%;
    background-color: #F95602;
    color:#000000;}
    
    #content {
    margin-left: 230px; */ added 20 more px to compensate for menu margin-left */
    margin-right: 20px; */ right indent 20px; */
    background: #F95602;
    color:#000000;}
    
    The menu stops short in IE because you have <li> width (ul.css-menu li a) set to 180px (20 px less than the <ul>).

    Look here for proper css list menus:
    http://css.maxdesign.com.au/listamatic/

    Also, you may have to increase the #content margin-left to accomodate IE css bugs.
     
    Last edited: 2009/02/03
  12. 2009/02/03
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Thanks again Tony,

    I've not applied the IE menu fix yet but I'll get round to it. I think I'm getting the hang of CSS now though, but if you think of any other improvements I'll be delighted to hear them.

    Edit:
    And if anyone uses a browser other than IE or FF, I'd be interested in how the site looks to you.

    www.yaawns.myby.co.uk
     
    Last edited: 2009/02/03
  13. 2009/02/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    I would add 10px padding-top to the #menu div.
     
  14. 2009/02/03
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Yeah I thought about that a couple of hours ago.

    I was wondering why the header was borked above the menu. I assumed it was a rendering issue until I realised it was the menu itself :eek:
     
  15. 2009/02/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    It was not really borked, it's the /* Thin Black Top Border */ that made it appear borked.
     
  16. 2009/02/08
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Me again :)

    This is not a problem but more an annoyance this code...

    Code:
    <form method=POST action= "mailer ">
      <p>
        Your Name:<br>
        <input type=text name=name size=40><br>
        Your Email:<br>
        <input type=text name=email size=40><br>
        Subject:<br>
        <input type=text name=subject size=40><br>
        Your Message:<br>
        <textarea rows=7 cols=48 name=comments></textarea><br>
        <input type=submit>
        <input type=hidden name= "id" value=" ">
      </p>
    </form>
    
    kicks up several HTML 4.01 strict errors but if I don't close the paragraph before closing the form then it's compliant :confused:

    The link to the compliant(?) code is here in case I've missed anything earlier in the page. Any ideas?
     
  17. 2009/02/08
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Not sure what you mean, I copy+paste your source into the w3c validator, ad the </p> & it passes.

    Just for neatness, I'd ad quotes to all the values in the form. (not necessary for validation though)

    I suspect the error you get is caused by the mailer application somehow. Ad the closing </p> tag, upload it and revalidate. Then post the exact error(s) shown at the w3c validator page.
     
    Last edited: 2009/02/08
  18. 2009/02/08
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Tony,

    Thanks for looking in and for all your assistance so far...

    I'm about to go out (hopefully if this lift shows up) but I'll post further details when I return.

    BTW you and Windows BBS already have a mention on my blog, your assistance has been most welcome.
     
  19. 2009/02/08
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Thanks. How about linking TonyT like this:
    Code:
    <p>
    I'm getting there, I've been adding to the site over the last couple of days and thanks mainly to <a href= "https://mvp.support.microsoft.com/profile=2DAB7D6F-22FB-407B-8CAB-82A3269096D2" target= "_blank ">TonyT</a> on the <a href= "http://www.windowsbbs.com" title= "Windows Support Forum ">Windows BBS</a> the<acronym title= "Cascading Style Sheet ">CSS</acronym> has improved. <acronym title= "By The Way ">BTW</acronym>if you ever need any kind of support for windows/hardware/networking etc I <strong>strongly</strong>recommend a visit to that site.
    </p>
    
     
    Last edited: 2009/02/08
  20. 2009/02/08
    wildfire

    wildfire Getting Old Thread Starter

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Re the link, I'l do it now ;)

    As to the error you're probably right regarding the mailer (ISP supplied I have no control over it). If I put the page in a different folder it passes 4.01 strict if I put in the folder my ISP requires the error I get is:

    Sorry for saying there were multiple errors that was from another test I did (without the problem paragraph).
     
  21. 2009/02/09
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    If you wish to continue to use the host's mailer, then do this:

    <form method=POST action= "mailer ">
    <p>
    Your Name:<br>
    <input type=text name=name size=40><br>
    Your Email:<br>
    <input type=text name=email size=40><br>
    Subject:<br>
    <input type=text name=subject size=40><br>
    Your Message:<br>
    <textarea rows=7 cols=48 name=comments></textarea><br>
    <input type=submit>
    <input type=hidden name= "id" value=" ">
    </p><p>
    <input type=hidden name= "id" value=" "></p></form>
    </div>

    Does your host support php?

    Your mail form has no error checking. I suggest having at least the sender's email address a required field.

    This small dhtml will ensure the sender enters an email address and it will ensure the address is a valid one:
    Code:
    <!-- begin form validation --><script type='text/javascript'>
    function validate() {
    sender_email = document.getElementById( "sender_email ").value;
    filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
    if (sender_email == " ") {
    hideAllErrors();
    document.getElementById( "sender_emailError ").style.display =  "inline ";
    document.getElementById( "sender_email ").focus();
    return false;
    }
    else if (!filter.test(sender_email)) {
    hideAllErrors();
    document.getElementById( "invalid_emailError ").style.display =  "inline ";
    document.getElementById( "sender_email ").select();
    document.getElementById( "sender_email ").focus();
    return false;
    }
    return true;
    }
    function hideAllErrors() {
    document.getElementById( "sender_emailError ").style.display =  "none "
    document.getElementById( "invalid_emailError ").style.display =  "none "
    }
    </script>
    
    <style type= "text/css ">
    span.error {
    color:#ffffff;
    display:none;
    }
    </style><!-- end form validation -->
    
    
    <form method=POST action= "mailer ">
    <p>
    Your Name:<br>
    <input type=text name=name size=40><br>
    Your Email:<br><span class= "error" id= "sender_emailError ">Please enter your email address.<br></span><span class= "error" id= "invalid_emailError ">Error! Invalid email address.<br></span>
    <input type=text name=email size=40 id= "sender_email "><br>
    Subject:<br>
    <input type=text name=subject size=40><br>
    Your Message:<br>
    <textarea rows=7 cols=48 name=comments></textarea><br>
    <input type=submit>
    <input type=hidden name= "id" value=" ">
    </p>
    </form>
     
    Last edited: 2009/02/09

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.