The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> inline style, attributes and /or values ???
pinklemon
post Jul 2 2014, 11:15 AM
Post #1


Advanced Member
****

Group: Members
Posts: 140
Joined: 29-June 14
Member No.: 21,166



Hello!
In this code:

CODE

<body style="background-color:yellow;">
<h2 style="background-color:red;">This is a heading</h2>
<p style="background-color:green;">This is a paragraph.</p>
<p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p>
<h1 style="text-align:center;">Center-aligned heading</h1>
</body>


I suppose, style is an attribute, isnt't it?
But, what are :

-> background-color
-> color
-> font-family
-> font-style
-> text-alignment

..and what are:
-> red
-> green
-> center
-> 20px ... etc

are BOTH of them VALUES???


Many thanks!!!

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 2 2014, 12:37 PM
Post #2


.
********

Group: WDG Moderators
Posts: 7,858
Joined: 10-August 06
Member No.: 7



QUOTE(pinklemon @ Jul 2 2014, 06:15 PM) *

I suppose, style is an attribute, isnt't it?

Yes.

QUOTE
But, what are :

-> background-color
-> color
-> font-family
-> font-style
-> text-alignment

These are CSS properties (though "text-alignment" is invalid).

QUOTE
..and what are:
-> red
-> green
-> center
-> 20px ... etc

These are CSS property values.

QUOTE
are BOTH of them VALUES???

Yes, all the CSS is a value of the HTML attribute STYLE. The CSS in turn consists of CSS properties and CSS values. See also http://htmlhelp.com/reference/css/quick-tutorial.html

BTW it's more practical to use external or embedded stylesheets instead of the STYLE attribute, see http://htmlhelp.com/reference/css/style-html.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pinklemon
post Jul 3 2014, 11:29 AM
Post #3


Advanced Member
****

Group: Members
Posts: 140
Joined: 29-June 14
Member No.: 21,166



Hello!
Many thanks!
Please, why is text-alignment invalid?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
illegit
post Jul 3 2014, 01:00 PM
Post #4


Newbie
*

Group: Members
Posts: 11
Joined: 3-July 14
Member No.: 21,197



There's no text-alignment property. If you want to adjust your text alignment, use text-align.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Jul 3 2014, 03:17 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Because text-alignment is the wrong property syntax.
See also http://htmlhelp.com/reference/css/text/text-align.html .
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 22nd July 2018 - 03:36 PM