answersLogoWhite

0

Even if you are not a web designer, you are probably aware that your site has been written in HTML. HTML was originally intended as a means of describing the content of a document, not as a means to make it appear visually pleasing. Semantic code returns to this original concept and encourages web designers to write code that describes the content rather than how that content should look. For example, the title of a page could be coded like this:

This is the page title

This would make the title large and bold giving it the appearance of a page title, but there is nothing that describes it as a title in the code. This means a computer is unable to identify this as being the page title.

To write the same title semantically so that a computer understands that this is a title, you would use the following code:

This is a heading

The appearance of your heading can then be defined in a separate file called a "cascading style sheet" without interfering with your descriptive (semantic) HTML code.

Why Is Semantic Code Important?I have already hinted at one reason why semantic code is important when I said that without explaining what a piece of content is, a computer has no way of identifying it. The ability for a computer to be able to understand your content is important for a number of reasons:
  • Many visually impaired people rely on speech browsers to read pages back to them. These programs cannot interpret pages very well unless they are clearly explained. In other words semantic code aids accessibility
  • Search engines need to understand what your content is about in order to rank you properly on search engines. Semantic code tends to improve your placement on search engines, as it is easier for the "search engine Spiders" to understand.

However, semantic code has other benefits too:

  • As you can see from the example above, semantic code is shorter and so downloads faster.
  • Semantic code makes site updates easier because you can apply design style to headings across an entire site instead of on a per page basis.
  • Semantic code is easier for people to understand too so if a new web designer picks up the code they can learn it much faster.
  • Because semantic code does not contain design elements it is possible to change the look and feel of your site without recoding all of the HTML.
  • Once again, because design is held separately from your content, semantic code allows anybody to add or edit pages without having to have a good eye for design. You simply describe the content and the cascading style sheet defines what that content looks like.
How To Ensure A Site Uses Semantic Code?There is no tool that can check for semantic code. It is a matter of looking at the code and seeing if it refers to colours, fonts or layout instead of describing what the content is. If looking at code all sounds a bit too scary then a good place to start is by asking your web designer if he codes semantically. If he looks at you blankly or starts waffling, you can be sure he does not. At that point you need to decide if you wish to pressure him into getting up tospeed or if you want to find yourself a new designer!
User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the difference between syntax and semantics in programming languages?

Syntax in programming languages refers to the rules and structure that dictate how code is written, such as correct use of punctuation and keywords. Semantics, on the other hand, refers to the meaning and interpretation of the code, including how the instructions are executed and the logic behind them. In essence, syntax is about the form of the code, while semantics is about its function and behavior.


What are semantics in PHP?

PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with <?php ?>. PHP is mix of few languages so semantics is mixed too.


What has the author Stephen Ullmann written?

Stephen Ullmann has written: 'Semantics' -- subject(s): Semantics 'The principles of semantics' -- subject(s): Semantics


When did The Semantics end?

The Semantics ended in 1996.


When was Journal of Semantics created?

Journal of Semantics was created in 1982.


What is a sentence for semantics?

Some people dont know the sentence for semantics.


When was Journal of Web Semantics created?

Journal of Web Semantics was created in 2003.


When was Natural Language Semantics created?

Natural Language Semantics was created in 1993.


What is distinction between semantics and syntax?

semantics = words; syntax = how they're used


Semantics in a sentence?

Semantics is either the study of meaning or the meaning of a words or sentences. A sample sentence is "Semantics aside, the athlete's performance is mesmerizing. "


Why do compiler writers need formal grammars?

Just as a person requires knowledge of the syntax (structure) and semantics (meaning) of a spoken language, so too does the compiler need to "understand" how to interpret what is being given to it. A formal grammar provides the rules of syntax and semantics.


What are the major differences between pragmatics and semantics?

Semantics is how we say something. Pragmatics is how we do something.