SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast blktallos's Avatar
    Join Date
    Nov 2007
    Location
    Cuyahoga falls,Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css/div Overlap graphics

    Ok i have a problom with One of my Divs that i Have On my Blog Page on my website.


    Here is the code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Feb-13ahh Im doing so so i think</title>
    </head>
    <body>
    <div align="center">
    <table border="3" width="760"
    height="768" bordercolor="#FFFFFF"
    bgcolor="#010101"
    background="http://i30.tinypic.com/20fxdms.jpg">
    <tr>
    <td height="658"
    width="746" valign="middle">
    <div style="position:
    absolute; width: 532px; height: 394px; z-index:
    2; left: 421px; top: 206px" id="layer4">
    <p align="left">
    <b><em>Feb-13</em></b><em>ahh Im doing so so i
    think im slacking More because its My "senior
    Year". For some reason i had been a lil
    depressed.Like Someone is and has been on my
    mind alot lately its so complicated to
    understand.I wonder if it will ever will go
    away? Idk.I love Lauren its so great to be with
    her But there's time and feeling's that
    change.I dont know why im saying this i love
    her to death..Currently working on a project
    for her Grandpa <a
    href="http://balintassociates.com/dwenvelopes.a
    spx">Balint&amp;associates</a></em><br />
    <span class="c6"><em>Feb-15,08<br />
    Seriously i get so mad at myself.I always feel
    like i get nothing and its Bull****.alot of
    people think im a ******* Oh ****ing well i
    dont give a **** anymore. i swear i can never
    do what i want:/ Cant wait till This school
    year end's. Its going to be the greatest Goal
    In my life accopmplished.i wish she would Just
    talk to me thats all i want Thats all im
    asking. i really do think thats why ive been
    having Fit's. Thing's arent just the 'Same'. It
    Suck's.</em></span><br />
    </p>
    <p class="c7" align="left"><strong>Feb-19</strong><br />
    <em>I have been doing alot of work for other
    people and for some reason i can never find
    enough time to work on my own Website i have
    finished doing balint&amp;associates.working
    with some friends of mine<br />
    there a small group of kids that made a website
    for their web page class!trying to help them
    out with their Css!!<br />
    Maybe the more link's i have on my site The
    better seo ill have on my site









    i am using frontpage 2003 i am using 1 table and a div inside the table for Content Postioning.What is going on is when i put more text inside the div is that the div expands and the text expands on to my graphic which is not what i want.what i want is that the div stays in the same place and the Content just scrolls if anyone could direct me to what im doing wrong it would be appreciated.http://www.blakeanthonydesign.com/blog.html

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If you want scroll bars on an element then you need to add overflow:auto and then scroll bars will appear on the element if it exceeds the dimensions you set.

    Code:
    #layer4{overflow:auto}
    or in your inline style it would be:

    Code:
    <div style="position:absolute; width: 717px; height: 395px; z-index: 2; left: 335px; top: 204px;overflow:auto" id="layer4">
    You should note that inline styles are to be avoided at all costs and your css should be contained in an external stylesheet and not in the html. It would also be wise to use a valid doctype otherwise you will trigger quirks mode in ie6 and use the broken box model among other things (see faq).

    That is some very old fashioned code you are using and you should consider learning how to do this with css or at least how to remove deprecated elements from your code and keep the html clean and well structured.

    Hope it helps anyway

  3. #3
    SitePoint Enthusiast blktallos's Avatar
    Join Date
    Nov 2007
    Location
    Cuyahoga falls,Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you it worked I have a couple question's though why are inline style's be put in a external style sheet it works the same way if you Have it in the html?

    what is a reason why people use Valid doctype?


    and i know my html is not valid But its still html !!!! do search engines look at valid html?

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because inlined styles will over-ride ANYTHING that matches in an embedded or external stylesheet.

    For example if you have a DIV that has its background color set to red in an external stylesheet, then that same DIV has the background color set to puce in an inlined style, that DIV's background color will be puce, no matter what you do, until you remove it.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    I have a couple question's though why are inline style's be put in a external style sheet it works the same way if you Have it in the html?
    To follo on from what Dan has already said, imagine you are working on a site that has over 1000 pages and then the client says they now want the headings in red and the footers in blue.

    If all your styles are inline the you would have to edit all 1000 pages by hand which could take years. However, if you have constructed the page correctly you can change all 1000 pages in a couple of seconds by changing one or two values in the external stylesheet.

    The main premise of constructing html pages is that you separate presentation from content. Inline styles go against this premise and add weight to the page and make the pages so rigid as to be unusable in any real sense unless you are only constructing one single page.

    what is a reason why people use Valid doctype?
    So that they know the page conforms to a certain standard and will work more reliably cross browser. As I already said you will already be struggling with IE because it uses the broken box model when there is no doctype and therefore any elements that have widths, padding and borders will be a completely different size to other browsers.

    You also lose all the improvements and extra css properties that have been made in IE7 also so you may as well go out and get yourself IE5 to live with.

    If you want to progress with CSS and web design then it pays dividends to do it properly and have a well thought out structured approach.

    do search engines look at valid html?
    AFAIK search engines don't care if the page is valid or not but they will care that they have to trawl through miles of inline styles before they get to any of your content. Using inline styles makes the ratio between mark up and content worse and search engines love nice clean content.

    Search engines also do like structured pages especially the type of pages that valid code produces. The html elements should be used logically, structurally and semantically and will then provide better results. Use headings efficiently and in a logical structure and then use the correct html elements for the rest of the content. (e.g. lists in lists, paragraphs in p tags etc.).

    No one likes spaghetti code not even search engines.

    Read the basic introduction to CSS here as it explains these basic concepts and is worth taking the time to get right.

    Hope that explains it a bit :}

  6. #6
    SitePoint Enthusiast blktallos's Avatar
    Join Date
    Nov 2007
    Location
    Cuyahoga falls,Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well thank you for taking youre time to write all that. i am just starting my design what i really like doing is creating a new page to my website like everyday it's fun im trying to have valid code and work on seo for my site.

    so thank you for you taking youre time


Bookmarks

Posting Permissions

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