انجمن کامپیوتر دانشگاه ولی عصر رفسنجان
برای استفاده کامل از امکانات انجمن می بایست به انجمن وارد شوید، اگر هنوز عضو انجمن نیستید دکمه ثبت نام را فشار داده و در غیر اینصورت دکمه ورود را برای وارد شدن به حساب کاربری خود فشار دهید.

دستور زبان CSS Syntax

View previous topic View next topic Go down

دستور زبان CSS Syntax

Post by meys@m on 26/11/2009, 4:39 pm

????? ???? ?? CSS ?? ?? ??? ????? ??? ???: ?? ??????? ,?? ????? ? ?? ?????. (a selector, a property and a value) :
Code:
selector {property: value}


??????? ???? tag/element ?? HTML ??? ?? ?? ????? ????? ??? ??????? ????? ???? ?? ?? ????? ??? ?? ????? ????? ?????????? ????. ????? ? ????? ???? ?? ???? ?? ?? ??? ?? ???? ? ???? ?? ??? ?????? ???? ?? ?????.
Code:
body {color: black}
???? : ??? ????? ?? ????? ??? ???? ?? ??? ?? ?? ???? ??????? ???? ????.
Code:
p {font-family: "sans serif"}

????: ???? ????? ??? ????? ???? ?? ?? ?? ?? ?? ??? ???? ; ?? ?? ??? ????. ???? ??? ?? ???????? ??? ??? ?? ??? ????? ???? ????? ?? ???:
Code:
p {text-align:center;color:red}


???? ????? ?? ??? ?????? ?? ?????? ?? ????? ?? ?? ?? ?? ????? ????.
Code:
p
{
text-align: center;
color: black;
font-family: arial
}
???? ????:



??? ?? ?????? ?? ?? ????? ????? ?? ???? ????? ?? ??????? ?? ????? ????. ????? ?? ????? ???? ??? ? ??????? ?? ?????? ?? ???. ?? ??? ???? ??? ????? ????? ?? ?? ??? ??? ????? ???? ??????:
Code:
h1,h2,h3,h4,h5,h6
{
color: green
}
??????? ???? - The class Selector :



?? ??????? ?? ???? ?? ?????? ???? ?? ??? ????? html ?????? ??? ??????? ????? ??????. ???? ???? ??? ?? ?? ??? ???????? ???? ?????. ??? ??? ??? ? ????? ???? ???! ???? ??? ??? ?? ???? ??? ??? ?? ????:
Code:
p.right {text-align: right}
p.center {text-align: center}

??? ??? ?? ?????? ?? ???? ??? ????? ??? ?? ???? ?? ???? ??? ??????? ????:
Code:



This paragraph will be right-aligned.
Code:



This paragraph will be center-aligned.

???? : ??? ?? ?????? ?? ??? ???? ???? ?? ????? ??????? ????:
Code:



This is a paragraph.

???????? ???? ?? style ???? bold ?? ???? ? ?? center ??.

??? ?????? ?? ?????? ??? ?? ?? ?? ??????? ??? ???? ? ?? ??? ???? ??? ?? ?????? ?? ??? ???? ???? ????? ????? ????? ??? html ??????? ????. ?? ???? ??? ????? ????? ????? ??? html ?? ???? center ?? ???? ??? ??? ????? ???? ??????:
Code:
.center {text-align: center}

?? ???? ?? ??? ?? ?? ????? h1 ? p ?? ???? center ??????? ?? ????. ??? ???? ?????? ?? ?? ?? ?? ?????? ????? ??? ?? ???? center ???? ?? ????:
Code:

[b]
This heading will be center-aligned
[/b]

Code:



This paragraph will also be center-aligned.


????: ?????? ??? ?? ???? ?? ?? ??? ???? ????? ??? ?? ?? ?????? Mozilla/Firefox ??? ?????? ???.


?????? style ?? ????? ?? ?????????? ??? :



????? ??? ????? ????? input ???? ?? ????? type ?? ????? text ????? ?? ?? ??? ??? ????? ?????:
Code:
input[type="text"] {background-color: blue}


????? ?? ?? ??????? ??:



??? ?? ?????? ?? ?????? ?? ????? # ?? ????? ???? ??????? ?? ????? ????.

????? ????? ??? ?? ??? ?? ?????? ?????? ????? ??? ?? ????? id ?? ????? green ????? ????:
Code:
#green {color: green}

?????? ??? ????????? ?? id ?? ????? paral ????? ???? ?? ?? ?? ??????:
Code:
p#para1
{
text-align: center;
color: red
}
????: ?????? ??? ?? ????? ?? ?? ??? ???? ????? ??? ?? ?? ?????? Mozilla/Firefox ??? ?????? ???.


??????? ?? ?? ?? ?? - CSS Comments




?? ??????? ???? ????? code ?? ??????? ?? ???. ??????? ?? browser ????? ???? ??? ????. ??????? ?? ???? /* ? */ ???? ?? ????.
Code:
/* This is a comment */
p
{
text-align: center;
/* This is another comment */
color: black;
font-family: arial
}
?????: ?? ????? ??? ????

_________________
If at first you don't succeed; call it version 1.0
avatar
meys@m
Admin

تعداد پستها : 131
اعتبار : 8
Join date : 2009-05-06
Age : 27

در مورد من
رشته تحصیلی: ریاضی کاربردی

http://anarnet.ir

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum