Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di iMet
    Registrato dal
    Jan 2009
    Messaggi
    168

    Problema con Layout 2 colonne e immagine

    Ciao a tutti, ho il seguente problemino, vi posto il codice del sito che sto impostando...
    Quello che intendo fare è...nella parte superiore ho un immagine rossa di 950px stessa grandezza della casella di testo, e non voglio mutare la dimensione di tale immagine... quello che volevo fare è fare in modo che (siccome al centro ci metterò una scritta) una porzione dx e sx dell immagine andassero a ripetersi all infinito, in modo che un utente con un ipotetico schermo gigante si ritrovi l immagine rossa in alto che tocca i bordi del suo schermo, ma la casella di testo sempre a 950px.. tutto ciò per ovviare al problema del restringimento della pagina, dove se aumentassi la grandezza dell immagine oltre quella della casella di testo, restringendo la pagina web la scritta al centro dell immagine arrivata al limite si decentrerebbe e non seguirebbe piu la casella di testo.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: #FFFFFF;
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #000000;
    }
    .thrColAbs #container {
    position: relative; /* adding position: relative allows you to position the two sidebars relative to this container */
    width: 950px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
    background: #666666;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 1px solid #000000;
    text-align: left; /* this overrides the text-align: center on the body element. */
    }

    /* Tips for absolutely positioned sidebars:
    1. Absolutely positioned (AP) elements must be given a top and side value, either right or left. (As a default, if no top value is given, the AP element will begin directly after the last element in the source order of the page. This means, if the sidebars are first element in the #container in the document's source order, they will appear at the top of the #container even without being given a top value. However, if they are moved later in the source order for any reason, they'll need a top value to appear where you desire.
    2. Absolutely positioned (AP) elements are taken out of the flow of the document. This means the elements around them don't know they exist and don't account for them when taking up their proper space on the page. Thus, an AP div should only be used as a side column if you are sure the middle #mainContent div will always contain the most content. If either sidebar were to contain more content, that sidebar would run over the bottom of the parent div and the sidebar would not appear to be contained.
    3. If the above mentioned requirements are met, absolutely positioned sidebars can be an easy way to control the source order of the document.
    */
    /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. */
    padding: 0 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
    /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;

    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    }
    -->
    </style><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .thrColAbs #sidebar1 { width: 180px; }
    .thrColAbs #sidebar2 { width: 190px; }
    </style>
    <![endif]--></head>

    <body class="thrColAbs">
    <div>
    <div>
    [img]banner234.jpg[/img]</div>

    <div id="container">

    <div id="mainContent">
    <h1 align="center"></h1>
    <h1 align="center"> Main Content </h1>
    <p align="center">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
    <h2 align="center">H2 level heading </h2>
    <p align="center">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
    <div align="center">

    </div>
    </div>
    <div id="sidebar1">
    <h3 align="center">Sidebar1 </h3>
    <p align="center">The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if it will always contain more content. </p>
    <p align="center">Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
    <div align="center">

    </div>
    </div>
    <div id="sidebar2">
    <h3 align="center">Sidebar2 </h3>
    <p align="center">The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p>
    <p align="center">Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
    </div>
    </div>
    </div>
    </body>
    </html>
    Ciao a tutti e grazie!

  2. #2
    Utente di HTML.it L'avatar di iMet
    Registrato dal
    Jan 2009
    Messaggi
    168
    Per intenderci, questo sito ad esempio, ( http://creativenerds.co.uk/ ) potete allargarlo quanto volete che la barra rossa e gialla del head continuano all infinito, e non è un immagine perchè se selezionate, l immagine è solo quella con la scritta centrale!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.