Filehost.ro - gazduire fisiere
Informatica
Programare - Software - Web Design
Nou pe simpatie:
Sophya pe Simpatie
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 54 ani
InformaticaInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Informatica / Despre limbajele de programare /

Css 5 padding height width

Pagini: 1  
#1
Admin
Administrator
Postari: 315

Padding

Lasa un spatiu intre continut si border. In general e mai estetic sa fie lasat un spatiu intre text si bordura din jurul lui. Se poate insa aplica la mai multe elemente imagini, link-uri, tabele, liste etc.

Toate proprietatile intr-o singura declaratie:

<html>
<head>
<style>
td.test1 {padding: 1.5cm}
td.test2 {padding: 0.5cm 2.5cm}
</style>
</head>

<body>
<table>
<tr>
<td>
This is a tablecell with equal padding on each side.
</td>
</tr>
</table>

<table>
<tr>
<td>
This tablecell has a top and bottom padding of 0.5cm and a left and right padding of 2.5cm.
</td>
</tr>
</table>
</body>
</html>

Setarea padding-ului superior folosind procentul

<html>
<head>
<style>
td
{
padding-top: 10%
}
</style>
</head>
<body>

<table>
<tr>
<td>
This is a tablecell with a top padding
</td>
</tr>
</table>

</body>
</html>
Padding
Lasa un spatiu intre continut si border. In general e mai estetic sa fie lasat un spatiu intre text si bordura din jurul lui. Se poate insa aplica la mai multe elemente imagini, link-uri, tabele, liste etc.

Toate proprietatile intr-o singura declaratie:

<html>
<head>
<style>
td.test1 {padding: 1.5cm}
td.test2 {padding: 0.5cm 2.5cm}
</style>
</head>

<body>
<table>
<tr>
<td>
This is a tablecell with equal padding on each side.
</td>
</tr>
</table>

<table>
<tr>
<td>
This tablecell has a top and bottom padding of 0.5cm and a left and right padding of 2.5cm.
</td>
</tr>
</table>
</body>
</html>

Setarea padding-ului superior folosind procentul

<html>
<head>
<style>
td
{
padding-top: 10%
}
</style>
</head>
<body>

<table>
<tr>
<td>
This is a tablecell with a top padding
</td>
</tr>
</table>
</body>
</html>

Setarea padding-ului din dreapta

<html>
<head>
<style>
td {padding-right: 5cm}
</style>
</head>

<body>
<table>
<tr>
<td>
This is a tablecell with a right padding. This is a tablecell with a right padding.
</td>
</tr>
</table>
</body>
</html>

Proprietatile sunt:

padding
padding-top, padding-right, padding-bottom, padding-left

Inaltimea si latimea

height,width

Setarea inaltimii folosind pixeli


<html>
<head>
<style>
img.normal
{
height: auto
}
img.big
{
height: 160px
}
img.small
{
height: 30px
}
</style>
</head>
<body>

<img class="normal" src="logocss.gif" width="95" height="84">

<img class="big" src="logocss.gif" width="95" height="84">

<img class="small" src="logocss.gif" width="95" height="84">

</body>
</html>

Setarea latimii folosind procent

<html>
<head>
<style>
img
{
width: 50%
}
</style>
</head>
<body>

<img src="logocss.gif" width="95" height="84">

</body>
</html>
</body>
</html>

Proprietatile


min-heigth, min-width
nu au efectul scontat in anumite browsere, deci trebuie folosite cu atentie


 
   
Pagini: 1  
Mergi la