tutoriale photoshop, brushes, patterns, gradient
Site afiliat proiectului Wtricks.com
   
   
  REGULAMENT | Search | Members | Calendar | Help  
 


Post Reply  Post Thread 
Stil Background CSS
Author Message
FrozenDesigns
Designer incepator
*****


Posts: 220
Group: Registered
Joined: Feb 2008
Status: Offline
Reputation: 0
Lei: 898.79
Post: #1
Stil Background CSS

Culoarea pentru fundal (background) sau imagine poate fi definită pentru întreaga pagină, o celulă a tabelului sau pentru text.

Culoare de fond
background-color defineşte culoarea de fond şi poate fi asociat oricărei etichete HTML.

Exemplu: definim un stil pentru întreg BODY şi un altul pentru eticheta p



Cod:

<html>
<head>
<title>Exemplu</title>
<style type="text/css">
<!--
body {background-color: #FFFF00;}
p {background-color: #FF0000;}
-->
</style>
</head>
<body>
Text normal
<p>Text cu background rosu</p>
</body>
</html>


Imagine de fond
Imaginile pot fi folosite ca fundal în spatele întregii pagini, a unui obiect sau a textului.
background-image asociază o imagine ca fundal unui obiect.

Exemplu: definim un stil pentru eticheta p



Cod:

<html>
<head>
<title>Exemplu</title>
<style type="text/css">
<!--
p {background-image: url(poza.jpg);}
-->
</style>
</head>
<body>
Text normal
<p>Text cu imagine de fond</p>
</body>
</html>


Repetare
Funcţie de dimensiunile obiectului căruia îi sunt asociate imaginile de fond se repetă pe orizontală şi verticală.
Repetarea poate fi controlată prin parametrul background-repeat care poate lua valorile:
repeat-x - imaginea se repetă pe orizontală
repeat-y - imaginea se repetă pe verticală
no-repeat - imaginea nu se repetă

Exemplu: imaginea nu se repetă sub eticheta p:



Cod:

<html>
<head>
<title>Exemplu</title>
<style type="text/css">
<!--
p {background-image: url(poza.jpg);
background-repeat: no-repeat;}
-->
</style>
</head>
<body>
Text normal
<p>Text cu imagine de fond</p>
</body>
</html>


Poziţia
În mod normal imaginea de fundal începe din colţul stânga sus al obiectului asociat, dar acest lucru poate fi controlat prin comanda CSS background-position.
Sunt acceptate două valori:
în prima poziţie poate fi: top, center, bottom, percentage sau pixel
în a doua poziţie poate fi: right, center, left, percentage sau pixel

Exemplu: imaginea de fundal este asociată etichetei BODY fiind amplasată top şi center, fără repetare:


Cod:

<html>
<head>
<title>Exemplu 5_4</title>
<style type="text/css">
<!--
body {background-image: url(poza.jpg);
background-repeat: no-repeat;
background-position: top center;}
-->
</style>
</head>
<body>
Text normal
</body>
</html>


My portofolio
02-15-2008 02:59 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

 

 Invatam Net
Esti nou pe aici? Vorbeste-ne despre tine.
Citeste articole si tutoriale unice.
Ai un site? Iti putem oferi un review.

  Parteneri

  

  

  UNIX, Linux, Programare si Scripting pentru incepatori

  

-->