Devo allineare 2 parole sulla stessa riga una a destra e una a sinistra.
come devo fare?
Grazie
Devo allineare 2 parole sulla stessa riga una a destra e una a sinistra.
come devo fare?
Grazie
Un idea non complessa ma intelligente sarebbe quella di utilizzare la proprieta white-space: pre;.
X Es:
Codice HTML/XHTML:
<!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" xml:lang="en" lang="en">
<head>
<title>Personal_Project</title>
<meta http-equiv="Content-Type" content="text/html"; charset:iso-8859-1" />
<link rel="stylesheet" type="text/css" href="ok.css" />
</head>
<body>
<div id="testo">
Test /* qui lasci lo spazio necessario che ti serve per distanziare le due scritte */ Test2</p></div>
</body>
</html>
Codice Css:
html,body{
margin: 0;
padding: 0;
}
#testo{
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
white-space: pre;
}
p{
margin: 0;
}
Qeusta soluzione nn va bene perchè lo spazio fra i 2 testi nn è fisso ma cambia essendi una paginaphp i testi sono dinamici
L'alternativa sarebbe questa:
Codice Html/Xhtml:
<!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" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="prova.css" />
</head>
<body>
<div id="Test">
<p id="T1">TESTO 1</p>
<p id="T2">TESTO 2</p>
</div>
</body>
</html>
Codice Css:
html,body{
background-color: #b22222;
margin: 0;
padding: 0;
font-size: 1.2em;
}
#Test{
margin: 0;
width: 100%;
position: relative;
}
#T1{
float: left;
font-weight: bold;
margin: 0;
}
#T2{
display: inline;
float: right;
font-weight: bold;
margin: 0;
}
Una cosa che devo ancora capire,è come evitare che il primo paragrafo si sovrapponga al secondo....ossia farlo andare a capo in automatico senza l'utilizzo del break(
).Ho realizzato un topic in merito senza aver avuto nessuna risposta.![]()