There are a few different ways using CSS to display text over an image. This technique is widely used in templates, for example, if you have a look at the sidebar of this website, you will see that it has text over a gradient image! I have done this by setting a background image in CSS, this will be the first way I show you how to display text over an image. Another way to display some text over an image is to use relative positioning.
This tutorial is for anyone that would like to make a webpage using HTML, it is designed for anyone with no prior knowledge of HTML. But if you have some knowledge on HTML this tutorial will be good to touch up on some of the elements you may have forgoten or have not learnt yet.
As you work your way through this tutorial you will find out how easy HTML code is. HTML is not a programming language but is just a simple code to change the looks of text and layout of content.
This is coming soon.
The <table> tag can create tables in HTML, but you must include the <tr> and <td> tags (see the example). The <table> tag can be used anywhere between the opening and closing <body> tags. It is a block-level tag so you may use inline and block-level tags inside this tag.
Table Example
Notes
You must include the 'border' attribute in the table tag, for borders to show
The 'align' and 'bgcolor' attributes are deprecated in HTML 4.01, and are not supported in XHTML 1.0 Strict !DOCTYPE
Attributes for the table tag
Common attributes for the table tag
Javascript Event attributes for the table tag
The <b> tag/<strong> tag is used to make bold text, the text will become much thicker then normal text.
Where/how To Use The <b>/<strong > Tag
Bold Example
Notes
- Use the strong or b tag to make your text stand out.
- Use the b tag for a pure presentational meaning and use the strong tag for giving your text more meaning to screen-readers.
- To give your text a bit less 'boldness' use the <i> or <em> tag. They render the text italic.
Common attributes for the bold tag
class, style, id, title, dir, lang
Common attributes for the strong tag
class, style, id, title, dir, lang, xml:lang
Javascript Event attributes for both bold tags
onmousedown, onmouseup, onclick, ondblclick, onmouseover, onmouseout, onmousemove, onkeydown, onkeyup, onkeypress
The object tag is used to embed objects such as flash and images etc.
Example
This example shows a YouTube video embedded using the object tag.
Notes
Attributes for the object tag
Common attributes for the object tag
Javascript Event attributes for the object tag
The <i> tag/<em> tag are used to make italic or emphasized text, the text will become slanted and thinner then normal text.
Where/how To Use The <i>/<em> Tag
Example
Notes
- Most browsers display <em> the same as <i>
- There are no differences between XHTML and HTML for this tag
- <em> and <i> display text as italic
Common attributes for the i tag
class, style, id, title, dir, lang
Common attributes for the em tag
class, style, id, title, dir, lang, xml:lang
Javascript Event attributes for the i and em tag
onmousedown, onmouseup, onclick, ondblclick, onmouseover, onmouseout, onmousemove, onkeydown, onkeyup, onkeypress
The <!DOCTYPE> tag tells the browser what to expect. If it is a Transitional doctype
it will tell the browser to use a non-standards mode. If it is a Strict doctype the browser will
switch to standards mode. This tag should be placed first on the page, before the <html> tag also if you are
using XHTML, this tag does not need to be closed.
Where/how To Use The <!DOCTYPE> Tag
Example - HTML 4.01
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0
XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Notes
Use the right doctype that is most suitable for your site.
If no doctype is present the browser will process the page as Transitional.
'doctype' is 'document type'.
The <!--comment--> tag is used to make hidden comments in html. This tag is great for
showing where you are in your html code. Like "<!--Start navigation-->" for the start of your
navigation code. Anyone that looks at your source code will be able to see these comments!
Where/how To Use The <!-- Comment --> Tag
Example
Notes
The <bdo> tag is used to make your text go the opposite or reverse way to the default.
Where/how To Use The <bdo> Tag
Example
Notes
Attributes for the base tag
Common attributes for the bdo tag
class, style, id, title, dir, xml:lang, lang
Javascript Event attributes for the bdo tag
The <basefont> Tag Is Deprecated - Use Styles Instead
The basefont tag is deprecated, use a style or class in the
instead.
eg. <body style="font-family: arial;">
The reason we do not provide information on deprecated tags, is simple, we don't want you to use outdated
html. It just saves a lot of problems such as: browser support and validation errors.
Definition of a Deprecated Tag
Deprecated tags are tags that are no longer specified in the W3C recommendation, it is strongly not advised
to use these tags. As browsers are not guaranteed to support them. At HTML Tips I will always try and
provide an alternative for a deprecated tag.