Tuesday, July 15, 2014

Styles 2

as i said before about styles and css each tag or object in web page has it own style attributes so for example there's width and height for everything but sure it doesnt has the same value for all i mean the width of pic its not as the same of the width of table thats why we should know how to use our width values and for the values we have few values here they are :

  • px - pixels
  • in - inches
  • cm - centimeters
  • mm - millimeters
  • pt - points
  • pc - picas (12 points)
  • em - height of the letter ‘m’
  • ex-height - height of the letter ‘x’
  • No space is allowed between the number and the unit specification e.g.,  1.5 in  is illegal!
  • Percentage - just a number followed immediately by a percent sign
and much more but these are enough the problem for beginners is about how to determine the real or wanted value i dont think you can know it immediately so the trying is the best thing you can do and the more used units are pixels and the percentage
so lets start out example with the same last steps:
1-open notepad 
2-lets write this :
<html>
<head>
</head>
<body>
<img src="your_pic_url.jpg" style="width:300px;"> */ its very important to use ":" and the semi colon ";" 
</body>
</html> 
3-press ctrl+s to save it 
4-name it as you want but dont forget to put the ".html" after the file name 
5-open it by your web browser or just click on it :)
Have a nice day

No comments:

Post a Comment