Elemente de baza

postat acum 4 ani de Stefanescu Mihai in categorie HTML

Am spus si in lectia trecuta, documentele HTML sunt formate din mai multe tag-uri ( care formeaza elementele).

Orice element HTML are urmatoarea forma: <se deschide tag-ul> continutul elementului </se inchide tag-ul>

Tag-urile de Heading

Orice document HTML incepe cu un heading.

Se pot folosi diferite dimensiuni pentru heading, dar acest lucru este facut mult mai usor de HTML, care vine cu 6 asemenea elemente :

<h1>, <h2>, <h3>, <h4>, <h5> si <h6>.Inainte si dupa aceste tag-uri este introdus un line break.

<html>
	<head>
		<title>Exemplu Heading</title>
	</head>
<body>
	<h1>Heading 1</h1>
	<h2>Heading 2</h2>
	<h3>Heading 3</h3>
	<h4>Heading 4</h4>
	<h5>Heading 5</h5>
	<h6>Heading 6</h6>
</body>
</html>

Codul de mai sus va avea urmatorul rezultat:

Tag de Paragraf

Tag-ul <p> iti ofera posibilitatea de a-ti structura textul in paragrafe. Fiecare pragraf trebuie sa fie scris intre tag-urile <p> si </p>:

<!DOCTYPE html>
<html>
	<head>
		<title>Exemplu Paragrafe</title>
	</head>
<body>
	<p>Primul Paragraf</p>
	<p>Al doilea paragraf</p>
 
</body>
</html>

Tag-ul pentru Line Break

In orice loc folositi tag-ul <br /> orice continut vine dupa el va fi mutat cu un rand mai jos. Acest tag contine si unspatiu intre br si slash, iar daca acesta este omis browserele mai vechi nu vor face nimic (ca si cand acel tag nu ar fi acolo.).

Atentie! Acest tag nu se inchide, se posteaza decat codul <br /> unde doriti sa inserati un rand nou si atat.

<!DOCTYPE html>
<html>
<head>
<title>Exemplu Line Break</title>
</head>
<body>
<p>Salut<br />
Avem un break mai sus si unul.<br />
la sfarsitul acestui rand.<br />
Salut!</p>
</body>
</html>

Acest cod va avea urmatorul rezultat:

Salut
Avem un break mai sus si unul.
la sfarsitul acestui rand.
Salut!

 Linii Orizontale

Liniile orizontale sunt folosite pentru a separa sectiuni din document. Tag-ul <hr> creeaza o linie orizontala de-a lungul ecranului dintr-o margine pana in cealalta a elementului parinte.

<!DOCTYPE html>
<html>
<head>
<title>Exemplu linie orizontala</title>
</head>
<body>
<p>Paragraful de sus</p>
<hr />
<p>Paragraful de jos</p>
</body>
</html>

Atentie! Acest tag nu se inchide, se posteaza decat codul <hr /> unde doriti sa inserati o linie orizontala si atat.

Pastrarea formatarii

Exista momente in care doresti sa pastrezi formatarea unui text exact ca intr-un document HTML, iar pentru aceste cazuri avem la dispozitie tag-ul <pre>.

Orice text pus intre tag-urile <pre> si </pre> isi va pastra formatarea din documentul sursa.

<!DOCTYPE html>
<html>
<head>
<title>Exemplu Pastrare Fomratare</title>
</head>
<body>
<pre>
function testamFunction( stringText ){
   alert (stringText)
}
</pre>
</body>
</html>

Va fi afisat astfel:

function testamFunction( stringText ){
   alert (stringText)
}

 

Sunt un tanar programator din Bucuresti ce lucreaza in PHP/Mysql (MySqli/PDO), Laravel, CodeIgniter, MySQL, PostgreSQL, Wordpress, HTML5/CSS3, Sass, Photoshop si multe altele.
Google+ Community Facebook Group
Acest articol a fost mutat de pe vechea platforma.
Pentru orice eroare aparuta la mutare va rog sa ma contactati!

Comentariu postate de minecraft for free la data de 14.05.2019
Everyone loves what you guys are up too. This type of clever work and exposure! Keep up the terrific works guys I've added you guys to my personal blogroll.
Comentariu postate de minecraft free download la data de 15.05.2019
Have you ever thought about adding a little bit more than just your articles? I mean, what you say is valuable and all. However think about if you added some great photos or videos to give your posts more, "pop"! Your content is excellent but with pics and video clips, this blog could definitely be one of the greatest in its field. Amazing blog!
Comentariu postate de minecraft free download pc la data de 15.05.2019
I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get setup? I'm assuming having a blog like yours would cost a pretty penny? I'm not very internet savvy so I'm not 100% sure. Any recommendations or advice would be greatly appreciated. Appreciate it
Comentariu postate de air max la data de 16.05.2019
My wife and i ended up being so relieved when Emmanuel managed to do his analysis through the entire precious recommendations he acquired through the blog. It's not at all simplistic to simply continually be releasing methods which usually some others could have been selling. And now we discover we now have the writer to thank because of that. The type of illustrations you made, the straightforward site navigation, the friendships you aid to promote - it's most terrific, and it is aiding our son and the family understand that subject is awesome, which is extremely pressing. Many thanks for the whole lot!
Comentariu postate de minecraft download for free la data de 17.05.2019
Hi there would you mind sharing which blog platform you're using? I'm planning to start my own blog in the near future but I'm having a hard time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I'm looking for something unique. P.S My apologies for getting off-topic but I had to ask!
Comentariu postate de minecraft free download pc la data de 17.05.2019
I have read so many articles or reviews on the topic of the blogger lovers except this piece of writing is actually a fastidious article, keep it up.