Thursday, July 30, 2009

Anyone one who knows HTML language please help?

CONFUSED: - What is the difference between SYNTAX and ATTRIBUTE





=-=-=--=-=-=-=-=-=-=-=-=-=





First question:





Look at this: -


If you ask me to give you the SYNTAX for making the text Robert BOLD. Which one of these would be right though??





a. %26lt;b%26gt;Robert%26lt;/b%26gt;


OR


b. %26lt;element%26gt;content%26lt;/element%26gt;





My answer:-


I say this is the syntax %26lt;element%26gt;content%26lt;/element%26gt; because a syntax is the formula you use but you haven't placed anything inside it yet.





=-=-=--=-=-=-=-=-=-=-=-=-=





Second Part:





Now watch this if you ask me to give you the ATTRIBUTE for making the text Robert BOLD. Which one would you choose now??





My answer, I looked up attribute and another synonym was "ELEMENT".


So they now asking me to fill out the syntax with something e.g. A+B=C. when they say they want the attribute the want this then 4+4=8?? See I filled out the syntax or the formula with something.





So the syntax %26lt;b%26gt;Robert%26lt;/b%26gt; would be the attribute because it's filled out right??





=-=-=--=-=-=-=-=-=-=-=-=-=

Anyone one who knows HTML language please help?
You are correct about syntax.


Syntax is the structure of a language.





HTML has a syntax.


This has bad syntax: %26lt;/b%26gt;Hello%26lt;/b%26gt;


You see the language is not adhering to the correct syntax.





Next attributes in HTML are not thing like %26lt;b%26gt; attributes are the part of a tag where you specify something additional.





using an attribute to make something bold you could write %26lt;span style='font-weight:bold;'%26gt;Hello%26lt;/span%26gt;





What is the attribute? Style is.





An image tag has a src attribute, and alt attribute and can have other attributes.





Another attribute is class.





Pretty much, you can tell an attribute by the fact it has an equal sign after it and then something in quotes (If your synatx is correct)





attribute="something"


width="100"


colspan="2"





the attribute is always the word before the = sign.





Best wishes.
Reply:I agree with Jibblet!





Syntax is the grammar, structure, or order of the elements in a language statement. (Semantics is the meaning of these elements.)





Syntax applies to computer languages as well as to natural languages. Usually, we think of syntax as "word order."





Attribute is nothing but, a property or characteristic.


Color, for example, is an attribute of your hair.





In using or programming computers, an attribute is a changeable property or characteristic of some component of a program that can be set to different values.





In the DOS operating system, file properties, such as "read-only" or "visible," are called file attributes.





Hope my answer helps





regards


http://www.awesomeflashsites.com


No comments:

Post a Comment