Website Development Prices

Pretrazite Blog // Search This Blog

Monday, February 29, 2016

Kako da obojite pozadinu naslova (How to add a background color to a heading)

Pitanje: kako da obojite pozadinu naslova?

Resenje: svojstvo background-color.

Primer:

HTML kod

<!DOCTYPE html>
<html>
<head>
<title>Kako da obojite pozadinu naslova</title>

<meta charset="UTF-8"/>
<meta name="description" content="Description that search reads" />
<meta name="keywords" content="page keywords, keywords" />
<meta name="author" content="Marija Rikic">
<link rel="icon" type="image/png" href="images/favicon.jpg">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>

Manipulacija podacima u nizovima (Manipulating data in arrays)

Ako zelite da obrisete duple elemente koristite funkciju array_unique().

Primer:

<?php

$cene_motora = array(3500, 3700, 2300, 3500, 3500);
print_r($cene_motora);

$cene = array_unique($cene_motora);
print_r($cene_motora);

?>

Rezultat:

Array ( [0] => 3500 [1] => 3700 [2] => 2300 [3] => 3500 [4] => 3500 ) Array ( [0] => 3500 [1] => 3700 [2] => 2300 )

Ako zelite da saberete sve vrednosti koje se nalaze u nizu, koristite funkciju array_sum().

Sunday, February 28, 2016

CSS: Selectors

The selector is a term that defines on what HTML tags is necessary to apply the rule.

Selectors may be:
  • names tags - the declaration applies to all such tags
  • id elements - the declaration refers only to an element with this unique identifier
  • class elements - the declaration applies to all the elements that have the value within the class attribute. The attribute class can have more words and then each word is a separate class.
  • combination of selectors - for example, an element with a certain tag, under condition that has a certain class.
To select elements with a certain identifier you should use "#" in front of the id, and to select class elements "." in front of desired class.

Example:

Saturday, February 27, 2016

Multimedia - images, svg, audio and video

The multimedia content represents pictures, sound, animation and video elements that appear on the pages.


Pictures


To insert the image in an HTML page use the <img> element, which has no end tag, and it's always empty. Attributes that are commonly used are src and alt.

Example:

<!-- absolute path -->
<img src="http://www.example.com/imagename.png" alt="image name">
<!-- relative path -->
<img src="images/suzuki.jpg" alt="suzuki motorcycle">

Result:




Thursday, February 25, 2016

Poredjenje nizova (Comparing arrays)

PHP podrzava poredjenje nizova i odredjivanje istih elemenata ili razlicitih. 

Pimer: ako imate sledeca dva niza i ako je u njima drugi element isti.

<?php

$japan = array("honda", "suzuki", "kawasaki");
$kina = array("shineray", "suzuki", "thumpstar");



?>

Pomocu funkcije array_diff() mozete napraviti novi niz. U ovom primeru dacemo ime $razlicito i u njemu ce se naci elementi koji su u ova dva niza razliciti.

Nastavak primera: 

Wednesday, February 24, 2016

CSS: formatting content

Colors


CSS allows you to define different color elements, such as the text color (color), background color (background-color), border color (border-color) and so on. It is only necessary to assign a value to these styles. The most commonly used are next three ways to specify colors:
  • hexadecimal value preceded by the # sign
  • RGB (Red Green Blue) value
  • standard color name (red, blue, green)
Example:

<h1>This is title 1</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pellentesque tortor et convallis consequat. Interdum et malesuada fames ac ante ipsum primis in faucibus</p>
<h2>This is title 2</h2>

<img src="images/three.gif" style="border:5px solid yellow" />

Result:


Monday, February 22, 2016

HTML elements - links and formatting text

 There are a certain number of tags for formatting text.

Example:

<p>This is text with <b>bold</b>, <i>italic</i>, <u>underline</u> and <s>strikethrough</s> letters. It also contains a combination of styles, such as <b><i>bold and italic</i></b>. Text within         HTML tags will        ignore the extra space between the words         and new rows     <pre>unless      you use       the tags for  reformatting</pre>.

</p>

Result:



Note: even though the text can be formatted using the above attributes, this mode is not desirable. If you want to define how a text is displayed, you should use CSS rules, rather than using HTML tags. Conclusion: HTML should only define the structure of the text, but not the rules for presentation.

The text you need to format set in <span> tags, and add some CSS class.

Search Blog

Price za decu