Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: wyrównanie tekstu
Forum PHP.pl > Forum > Po stronie przeglądarki
cedunio
Mam jakieś tam stronki x i y które otwierają mi się w divach.
Jednak tekst w nich nie wyświetla się tak samo.

oto zrzut ekranu ma ktoś jakiś pomysł dlaczego tak się dzieje.
W razie czego mogę wsadzić kod strony z divami bo jak na razie stronki x i y to ciąg znaków bez żadnego formatowania.

Pozdrawiam
Shili
A co chcesz osiągnąć - wyrównać tekst, czy ułożyć divy?

I tak, jeśli chcesz pomocy, to wypadałoby dodać kod.
Zgadując mogę powiedzieć, że wygląda na to, jakbyś miał użyte style float, ale jednocześnie za duże szerokości tekstu
cedunio
Kod
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <title>Faux Column CSS Layouts - 2 Column - faux-11-2-col</title>
   <link rel="stylesheet" type="text/css" href="main.css" />
   <script language="JavaScript" type="text/JavaScript">
  
   //object detection to return the correct object depending upon broswer type. Used by the getAXHA(); function.
   function getNewHttpObject() {
       var objType = false;
       try {
           objType = new ActiveXObject('Msxml2.XMLHTTP');
       } catch(e) {
           try {
               objType = new ActiveXObject('Microsoft.XMLHTTP');
           } catch(e) {
               objType = new XMLHttpRequest();
           }
       }
       return objType;
   }
  
   //Function used to update page content with new xhtml fragments by using a javascript object, the dom, and http.
   function getAXAH(url,elementContainer){
       document.getElementById(elementContainer).innerHTML = '<blink class="redtxt">Loading...<\/blink>';
       var theHttpRequest = getNewHttpObject();
       theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};
       theHttpRequest.open("GET", url);
       theHttpRequest.send(false);
  
           function processAXAH(elementContainer){
              if (theHttpRequest.readyState == 4) {
                  if (theHttpRequest.status == 200) {
                      document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
                  } else {
                      document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message:&nbsp;" + theHttpRequest.statusText +"<\/p>";
                  }
              }
           }
  
   }
  
   </script>
  
   </head>
  
   <body>
  
      <!-- Begin Wrapper -->
      <div id="wrapper">
      
            <!-- Begin Header -->
            <div id="header">
            
                  This is the Header        
                  
            </div>
            <!-- End Header -->
            
            <!-- Begin Navigation -->
            <div id="navigation"><ul>
     <li><a href="1.html" onclick="getAXAH('1.html','leftcolumn');getAXAH('2.html','rightcolumn');return false;">Load blue Lorem Ipsum <strong>bold</strong> text</a>&nbsp;&nbsp;&zwnj;&nbsp;&nbsp;</li>
       <li><a href="2.html" onclick="getAXAH('2.html','leftcolumn');getAXAH('3.html','rightcolumn');return false;">Load green Lorem Ipsum <em>italic</em> text </a>&nbsp;&nbsp;&zwnj;&nbsp;&nbsp;</li>
       <li><a href="3.html" onclick="getAXAH('3.html','leftcolumn');getAXAH('1.html','rightcolumn');return false;">Load red Lorem Ipsum regular text </a></li>  &nbsp;&nbsp;&zwnj;&nbsp;&nbsp;
       <li><a href="Lorem-ipsum-nothing.htm" onclick="getAXAH('Lorem-ipsum-nothing.htm','content');return false;">Show example of Error</a></li>
  
   </ul></div>
            <!-- End Navigation -->
            
            <!-- Begin Faux Columns -->
            <div id="faux">
            
                  <!-- Begin Left Column -->
                  <div id="leftcolumn">
            
                        
            
                  </div>
                  <!-- End Left Column -->
            
                  <!-- Begin Right Column -->
                  <div id="rightcolumn">
                  
                        <a href="#">Download this CSS Layout</a>
                        
                        
  
  
                        
                        <h1>Faux Column CSS Layouts</h1>    
                        
                        <p> cos cos cos    </p>
                  
                  <div class="clear"></div>
                  </div>
                  <!-- End Right Column -->
                  
                  <div class="clear"></div>
                  
            </div>      
            <!-- End Faux Columns -->
            
      </div>
      <!-- End Wrapper -->
   </body>
   </html>

cz. 1

i css
Kod
   * { padding: 0; margin: 0; }
  
   body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
   }
   #wrapper {
    margin: 0 auto;
    width: 922px;
   }
   #faux {
    background: url(faux-3-2-col.gif);
    margin-bottom: 10px;
    overflow: auto; /* Paul O Brien Fix for IE www.pmob.co.uk */
    width: 100%
   }
   #header {
    color: #333;
    width: 902px;
    padding: 10px;
    height: 100px;
    margin: 10px 0px 0px 0px;
    background: #D1DBDB;
   }
   #navigation {
    color: #333;
    padding: 10px;
    margin: 0px 0px 0px 0px;
    background: #ABBEBE;
   }
   #leftcolumn {
    display: inline;
    color: #333;
    margin: 10px;
    padding: 0px;
    width: 220px;
    float: left;
   }
   #rightcolumn {
    float: right;
    color: #333;
    margin: 10px;
    padding: 0px;
    width: 663px;
    display: inline;
   }
   .clear { clear: both; background: none; }
   ul li {display:inline}


chce zrobić aby te teksty teraz nie są równe aby były równe( są one zamieszczone w 2 divach każdy osobno)
Shili
W jakim sensie równe?
Obok siebie, równej szerokości, równej wysokości, równych wymiarów? Równe to pojęcie bardzo względne.

Jak rozumiem ten tekst znajduje się w leftcolumn i rightcolumn?
cedunio
na równej wysokości
tak znajdują się tam gdzie napisałeś ale są to strony otwarte w tych divach czyli ten tekst należy tek jakby do 2 różnych stron
Shili
Napisałaś.

Pobawimy się w dodawanie:
Element nadrzędny ma 922 piksele

Obie kolumny:
663 + 220 + 10 (lewy margines lewego) + 10 (lewy margines prawego) + 10 + 10 (prawe marginesy).

Dodaj sobie na spokojnie i pomyśl czemu nie mieszczą się obok siebie.
cedunio
dzięki wielkie pomogło snitch.gif snitch.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.