Jump to content
php.lv forumi

teksta poziicija


alins

Recommended Posts

piemeera kods

<style>
div#main{width: 75%; margin: 10px 0 0 10px; background: #cccccc;}
div#main h2 {padding: 2px 5px 2px 5px; background: #888888; color:red;}
</style>

<div id="main">blablabla
  <h2>teksts1 teksts2</h2>
</div>

 

kaa vareetu dabuut lai, teksts1 ir kreisaa malaa un teksts2 labajaa malaa ieksh taa <h2>

Link to comment
Share on other sites

variants ar teiblu

<style>
.main{width: 75%; margin: 10px 0 0 10px; background: #cccccc;}
.h2 {padding: 2px 5px 2px 5px; background: #888888; color:red;}
</style>

<table border="0" cellpadding="0" cellspacing="0" width="50%">
<tr>
<td class="main" colspan="2">blaablaa</td>
</tr>
<tr>
<td align="left" class="h2">teksts1</td><td align="right" class="h2">teksts2</td>
</tr>
</table>

variants ar css float, bet nezinu kaa lai nepaartrauc background koloru

<style>
div#main{width: 75%; margin: 10px 0 0 10px; background: #cccccc;}
div#h2 {padding: 2px 5px 2px 5px; background: #888888; color:red;}
</style>

<div id="main">blablabla
 <h2 style="float:left; ">teksts1</h2><h2 style="float:right; ">teksts2</h2>
</div>

Edited by Kristabs
Link to comment
Share on other sites

šādi derēs?

<style>
div#main{width: 75%; margin: 10px 0 0 10px; background: #cccccc;}
.rinda {
background: #888888;
color:red;
padding: 2px 5px 2px 5px;
}
</style>

<div id="main">blablabla
<div class="rinda">
  <div style="float:left; ">teksts1</div><div style="float:right; ">teksts2</div>
  <div style="clear: both"></div>
</div>
</div>

Link to comment
Share on other sites

×
×
  • Create New...