Property’s Value Example
3.7 Background Image File
Concepts
Session 3
Formatting Text Using Tags
Code Snippet 11 demonstrates how to specify a background color for an HTML document.
Code Snippet 11:
<html>
<body bgcolor=”#E6E6FA”>
<h1>Hello world!</h1>
<p><a href=”http://www.w3schools.com”>
Visit W3Schools.com!</a></p>
</body>
</html>
Another way to specify a background color for a Web page is by using the style=”background-color: color” attribute. This attribute must be added to the
<body> tag. An example for applying a background color using the style attribute is as follows:
Example:
<body style=”background-color: yellow”>
The color name ‘yellow’ can also be replaced by the hex code or the rgb code.
The default text color of the page is specified as the foreground color. The foreground color can be specified by using the style=”color: color” attribute. An example for applying a background and foreground color using the style attribute is as follows:
Example:
<body style=”background-color: navy; color: yellow”>
3.7 Background Image File
A Web site developer can also insert an image as the background on a Web page. These background images are not recommended as sometimes the colors in the image may hide the text content. Hence, it is best to choose images with lighter shades. Also, as the image is tiled, it is best to choose an image that blends well and looks like a single image even after it is tiled.
Code Snippet 12 demonstrates the way to specify a background image in an HTML Web page.
Code Snippet 12:
<html>
<body background=”bgimage.jpg”>
</body>
</html>
Concepts
Session 3
Formatting Text Using Tags
3.8 Check Your Progress
Which of the following formatting element emphasizes the text as compared to its surrounding text?
(A) B (C) I
(B) Strong (D) U
Which of the following tag is used to specify a definition term?
(A) <em> (C) <dfn>
(B) <code> (D) <blockquote>
Which of the following are the two elements used for creating an ordered list?
(A) OL (C) LI
(B) UL (D) DF
The ___________ tag is used to apply preformatted text content to a Web page.
(A) <pre> (C) <dfn>
(B) <em> (D) <a>
_____________ fonts are used for programming code scripts, instruction texts, and ASCII characters.
(A) Spaced (C) Hyperspaced
(B) Monospaced (D) Preformatted
1.
2.
3.
4.
5.
Concepts
Session 3
Formatting Text Using Tags
3.8.1 Answers
1. B
2. B
3. A, C
4. A
5. B
Concepts
Session 3
Formatting Text Using Tags
Summary
The heading elements define headings for contents such as text and images.
The <hgroup> element is used to group titles and their subtitles.
Monospaced fonts are used for programming code scripts, instruction texts, and ASCII characters.
The <pre> tag is used to apply preformatted text content to a Web page.
To define a long quotation or block quotation, the <blockquote> tag can be used.
A list is a collection of items, which might be organized in a sequential or nonsequential manner. HTML supports three types of lists namely, ordered, unordered, and definition.
HTML provides background properties that specify the background color and image for the Web pages.
Concepts
Session 3
Formatting Text Using Tags
Try it Yourself
Create a Web page and insert the content provided containing the same formatting style as shown.
Sample Content
A multi-tier enterprise application consists of two types of objects: application logic components and persistent data objects. Application logic components represent actions and define methods that perform common tasks such as calculat-ing the order price, customer credit card billcalculat-ing, and so on. Session beans model the application logic components as they contain the logic to perform the application tasks.
It is easy and simple to manage the business data present in large organizations as objects rather than as relational rows in a database. Business data when treated as objects are easy to handle and manage as they are compact in nature.
Entities are not associated with only EJBs and can be used in Java 2 Standard Edition (J2SE) environment. The differences between an Entity and a Session bean are as follows:
Entities have a client-visibility and a persistent identity that is distinct from their object reference. Each entity is distinct from the other because of their identities. Clients can use identities to pass the reference of an entity to other applications. However, this is not possible with Session beans.
Entity bean cannot be accessed remotely, whereas Session beans can be accessed locally as well as remotely.
Entity’s lifetime is not dependent on the application’s lifetime. Entity bean have a much longer lifetime than a client’s session as it depends on how long the data is present in the database.
Entities represent data in a storage that is permanent as well as fault-tolerant and hence, they are long lasting and can survive application server or database crash. This data can be reconstructed in the memory. Hence, it can be said that entity is an in-memory representation of persistent data that:
Can be loaded from persistent store and its field populated with the stored data
Can be modified in-memory to change the data values Can be saved and correspondingly database is updated
Apply bold formatting for the required words as shown in the sample content.
Apply an unordered bullet list to the text as shown in the sample content.
1.