0% found this document useful (0 votes)
92 views

The CSS Box Model

The document defines several HTML elements and tags such as <div>, <p>, <img>, <a>, <style>, <title>, <hr>, <pre>, and <address>. It also discusses CSS properties like padding, margin, and the CSS box model. Finally, it provides explanations for several other HTML/CSS concepts like image maps, hyperlinks, style sheets, lists, alignment, and more.

Uploaded by

Manohar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

The CSS Box Model

The document defines several HTML elements and tags such as <div>, <p>, <img>, <a>, <style>, <title>, <hr>, <pre>, and <address>. It also discusses CSS properties like padding, margin, and the CSS box model. Finally, it provides explanations for several other HTML/CSS concepts like image maps, hyperlinks, style sheets, lists, alignment, and more.

Uploaded by

Manohar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

<blockquote> Defines a section that is quoted from another source

***The <div> tag defines a division or a section in an HTML document.

<div id="contentinfo">
<p>Welcome to our website. We provide tutorials on various subjects.</p>
</div>

-------------------------------------------------------------------------------------------------------------------------

***4) Why do we use css with html?

The main benefit in CSS, is that it manages to separate the style from the
content on your web page.
- You may want to change the way the HTML output looks. The best way to
do that is with a Cascading Style Sheet (CSS), Font family, type size,
colors,and other styles can be controlled with CSS for each kind of element .
The CSS Box Model
CSS, "box model" is used for designing and layout.

The CSS box model is a box that wraps around every HTML element. It consists
of: margins, borders, padding, and the actual content.

Margin

Border

padding

content
Explanation of the different parts:

 Content - The content of the box, where text and images appear
 Padding - Clears an area around the content. The padding is transparent
 Border - A border that surrounds the padding and content
 Margin - Clears an area outside the border. The margin is transparent

The box model allows us to add a border around elements, and to define space
between elements. 

Example
div {
    width: 300px;
    border: 25px solid green;
    padding: 25px;
    margin: 25px;
}

The total width of an element should be calculated like this:

Total element width = width + left padding + right padding + left border + right
border + left margin + right margin

The total height of an element should be calculated like this:

Total element height = height + top padding + bottom padding + top border +
bottom border + top margin + bottom margin

--------------------------------------------------------------

Prompt Dialog Box


The prompt dialog box is very useful when you want to pop-up a text box to
get user input. Thus, it enables you to interact with the user. The user
needs to fill in the field and then click OK.

---------------------------------------------------------------
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files
(text, graphic images, sound, video, and other multimedia files) on the World
Wide Web.  HTTP is an application protocol that runs on top of
the TCP/IP suite of protocols 

Parameters remain in browser history because they are part of the Parameters are not
URL saved in browser
history.

GET requests are re-executed but may The browser usually alerts the
not be re-submitted to server if the HTML user that data will need to be
is stored in the browser cache. re-submitted.

Easier to hack More difficult to hack

Yes, only ASCII


characters allowed. No
restrictions. Binary data is also
allowed

GET method should not be used when sending POST method used when
passwords or sensitive information. sending passwords or other
sensitive information.

Can be cached Not cached

 Attributes provide additional information about an element

 a title attribute is added to the <p> element.  The value of the title


attribute will be displayed as a tooltip when you mouse over the
paragraph:

<a href gives web address for an link

< img src Specifies the web address for an image

<style Specifies an CSS style for an element


<title Specifies extra information about an element 

The <hr> element is used to separate content in an HTML page:

The HTML <pre> Element


The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed-width font and it


preserves both spaces and line breaks:

-The HTML <address> element defines contact information (author/owner) of


a document or an article

The <bdo> element is used to override the current text direction:

<bdo dir="rtl">This text will be written from right to left</bdo>

 The CSS padding property defines a padding (space) between the text


and the border:

 The CSS margin property defines a margin (space) outside the border:

 For list styles in <ul> attribute is <ul style=”list-style-type:circle”>


 For list styles in <ol> attribute is <ol type=”1”>
----------------------------------------------------------------

 What is image map?

 Image map lets you link to many different web pages using a single image. You can
define shapes in images that you want to make part of an image mapping

Does a hyperlink apply to text only?

 No, hyperlinks can be used on text as well as images. That means you can convert
an image into a link that will allow user to link to another page when clicked. Just
surround the image within the <a href=” “>…</a> tag combinations.

 Do older html files work on newer browsers?


 Yes, older html files are compliant to the HTML standard. Most older files work on
the newer browsers, though some features may not work.

What is the use of using alternative text in image mapping?

 When you use image maps, it can easily become confusing and difficult to determine
which hotspots corresponds with which links. Using alternative text lets you put a
descriptive text on each hotspot link.

What are style sheets?

 Style sheets enable you to build consistent, transportable, and well-defined style
templates. These templates can be linked to several different web pages, making it
easy to maintain and change the look and feel of all the web pages within a site.

20) What bullet types are available?

 With ordered lists, you can select to use a number of different list types including
alphabetical and Roman numerals. The type attribute for unordered lists can be set
to disc, square, or circle.

What other ways can be used to align images and wrap text?

 Tables can be used to position text and images. Another useful way to wrap text
around an image is to use style sheets.

What is a marquee?

 A marquee allows you to put a scrolling text in a web page. To do this, place
whatever text you want to appear scrolling within the <marquee> and </marquee>
tags.

Can you change the color of bullets?

 The bullet color is always the same as that of the first character in the list litem. If you
surround the <li> and the first character with a set of <font> tags with the color
attribute set, the bullet color and the first character will be a different color from the
text.
How do you create a text on a webpage that will allow you to send an email when
clicked?

 To change a text into a clickable link to send email, use the mailto command within
the href tag.

\How are active links different from normal links?

 The default color for normal and active links is blue. Some browsers recognize an
active link when the mouse cursor is placed over that link; others recognize active
links when the link has the focus. Those that don’t have a mouse cursor over that
link is considered a normal link.

What happens if you open the external CSS file in a browser?

 If you try to open the external CSS file in a browser, the browser cannot open the
file, because the file has a different extension. The only way to use an external CSS
file is to reference it using <link/> tag within another html document.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy