Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,564,337 members, 5,928,059 topics. Date: Monday, 19 October 2020 at 11:28 PM

I Want To Build Websites All By Myself. Can I? - Webmasters (4) - Nairaland

Nairaland Forum / Science/Technology / Webmasters / I Want To Build Websites All By Myself. Can I? (2648 Views)

I Build Websites...... Any Kind Of Websites @cheap Rates / Build Websites For Your Business, E-commerce And Many More At Cheap Rates....... / What Can I Use To Build Websites Like This One (2) (3) (4)

(1) (2) (3) (4) (Reply) (Go Down)

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 11:00am On Oct 01
*HTML - STYLE SHEET (external CSS)*

*External Style Sheet*
If you need to use your style sheet to various pages, then it’s always recommended to define a common style sheet in a separate file. A cascading style sheet file will have extension as .css and it will be included in HTML files using <link> tag.

Example:
Consider we define a style sheet file "mystyle.css" which has following rules.


.red{
color: red;
}
.thick{
font-size: 20px;
}
.green{
color: green;
}

Here we defined three CSS rules which will be applicable to three different classes defined for the HTML tags. The above code will be written in the CSS style sheet "mystyle.css" as it is, nothing added, nothing less. I suggest you should not bother about how these rules are being defined because you will learn them while studying CSS. Now let's make use of the above external CSS file in our following HTML document:


<!DOCTYPE html>
<html>
<head>
<title>HTML External CSS</title>

<link rel="stylesheet" type="text/css" href="mystyle.css">

</head>
<body>

<p class="red">This is red</p>
<p class="thick">This is thick</p>
<p class="green">This is green</p>
<p class="thick green">This is thick and green</p>

</body>
</html>


Result is shown in the image uploaded below.

*Imported CSS - @import Rule*
@import is used to import an external stylesheet in a manner similar to the <link>element. Here is the generic syntax of @import rule.

Example:
Following is the example showing you how to import a style sheet file into an HTML document.


<head>
<@import “mystyle.css”;
</head>


This will yield same result as the <link> tag used above.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 9:34pm On Oct 01
*HTML - STYLE SHEET (CSS Rules Overriding)*

We have discussed four ways to include style sheet rules in an HTML document. Here is the rule to override any Style Sheet Rule.

Any inline style sheet takes the highest priority. So, it will override any rule defined in <style>...</style> tags or the rules defined in any external style sheet file.

Any rule defined in <style>...</style> tags will override the rules defined in any external style sheet file. Any rule defined in the external style sheet file takes the lowest priority, and the rules defined in this file will be applied only when the above two rules are not applicable.

Example:
Consider we define a style sheet file "mystyle.css" which has following rules.


.row1{
color: red;
}
.thick{
font-size: 20px;
}
.row2{
color: green;
}


Now let's make use of the above external CSS file in our following HTML document which has both internal CSS and inline CSS. Example shown in first image uploaded below. Result is shown in the second image uploaded below.

You can see that the values for the classes thick and row2 are different in our external style sheet from our internal style sheet, and the browser choose to follow the rules stated in the internal style sheet. Also where an inline CSS occurs stating the value of color property to be blue, the browser displays the text of that element in blue instead of the class row2 assigned to the same element which points the color property to purple.

The page is read from top to bottom, right from left. It sees the external style sheet first, then the internal, before the inline; so the inline comes out on top after the internal.

Note: External CSS comes in a separate CSS file linked to the actual HTML document. The difference between it and the internal CSS is simply creating a <style> element in the head section of the HTML document, preferably after the title element, and then placing the same thing you would write in your external style sheet in-between the open and close tags of the <style> element. An inline style sheet is simply using the style attribute inside an element to state the properties and their respective values.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 7:48pm On Oct 02
*CSS COMMENTS*

Many times, you may need to put additional comments in your style sheet blocks. So, itis very easy to comment any part in the style sheet. You can simply put your comments inside /*.....this is a comment in style sheet.....*/. You can use /* ....*/ to comment multi-line blocks in similar way you do in C and C++ programming languages. For example:


/* This is an external style sheet file */
H1, h2, h3 {
Color: #36C;
Font-weight: normal;
Letter-spacing: .4em;
Text-transform: lowercase;
}
/* end of style rules */

*Handling Old Browsers*
There are still many old browsers who do not support CSS. So, we should take carewhile writing our Embedded CSS in an HTML document. The following snippet shows howto use comment tags to hide CSS from older browsers:


<style type=”text/css”>
<!--
Body, td {
Color: blue;
}
-->
<style>

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 7:48am On Oct 03
*CSS MEASUREMENT UNITS*

CSS supports a number of measurements including absolute units such as inches, centimeters, points, and so on, as well as relative measures such as percentages and em units. You need these values while specifying various measurements in your style rules e.g.

border: 1px solid red; width: 3cm; font-size:7em; margin: 3%;

We have listed out all the CSS Measurement Units along with proper examples in the image uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 2:05pm On Oct 03
*CSS─ SYNTAX 1*

A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts:

Selector: A selector is an HTML tag at which a style will be applied. This could be any tag like <h1> or <table> etc.

Property: A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.

Value: Values are assigned to properties. For example, color property can have the value either red or #F1F1F1 etc.

You can put CSS Style Rule Syntax as follows:

Selector {property: value;}


Example: You can define a table border as follows:

table {border: 1px solid #C00;}


Here table is a selector and border is a property and the given value 1px solid #C00 is the value of that property. You can define selectors in various simple ways based on your comfort. Let me put these selectors one by one.

*The Type Selectors*
This is the same selector we have seen above. Again, one more example to give a color to all level 1 headings:

H1 {color: #36CFFF;}


*The Universal Selectors*
Rather than selecting elements of a specific type, the universal selector quite simply matches the name of any element type:

* {color: #000000;}


This rule renders the content of every element in our document in black.

*The Descendant Selectors*
Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, the style rule will apply to <em> element only when it lies inside the <ul> tag.

ul em {color: #000000;}


*The Class Selectors*
You can define style rules based on the class attribute of the elements. All the elements having that class will be formatted according to the defined rule.

.blue {color: blue;}


This rule renders the content in black for every element with class attribute set to black in our document. You can make it a bit more particular. For example:

H1.blue {color: blue;}


This rule renders the content in black for only <h1> elements with class attribute set to black. You can apply more than one class selectors to a given element. Consider the following example:

<p class="center bold"> This paragraph will be styled by the classes center and bold. </p>

*The ID Selectors*
You can define style rules based on the id attribute of the elements. All the elements having that id will be formatted according to the defined rule.

#green {color: green;}


This rule renders the content in black for every element with id attribute set to black in our document. You can make it a bit more particular. For example:

H1#green {color: green;}


This rule renders the content in black for only <h1> elements with id attribute setto black.
The true power of id selectors is when they are used as the foundation for descendant selectors. For example:

#green h2 {color: green;}


In this example, all level 2 headings will be displayed in black color when those headings will lie within tags having id attribute set to black.

Let's give a comprehensive example. See the images uploaded below, result included.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by Playthepianos: 2:10pm On Oct 03
I'm hiring SEO writers - if interested, I will pay

Hello, Nairalanders.

So I just started a project, and I need some seo writers.

For payment, I will pay you 3k to 5k per satisfying article. That's what I can afford for now. I will also add more if I am really impressed with your work.

Seo writing is not anyhow writing please.

But there is a twist about our deal

The kind of job I want to offer you is that, since it is a new project, there is no enough funds yet to pay you. But when the project grows, you are guaranteed of payment.

Please note that payment may take up to 3 to 6 months. So what you are about to do is an investment.

It makes sense because you can submit any number of articles daily. And guess what - you can do the work anywhere at your comfort, even in your room.

The number of rich and satisfying articles you submit will determine how much you would make at the end of the day.

You don't have to worry, I will pay you. Just that I am short of money at the moment, that's why I can't pay now.


My requirements

1. Good seo skills.
2. Knowledge of English language (how to use punctuations, tenses, concord etc).
3. Creative ability to make captivating titles, intros and body.
4. Knowledge of publishing on Wordpress (not necessary).


Apart from this, as we interact, I will teach you more about writing seo articles.
Sometimes, I will give you the topics to write about and the keywords to target.
I will help you improve your keywords research skills too.

Then you can create profiles on big marketplaces like Fiverr, Upwork etc, and make money with the skill you learnt.


There is more to discuss.

If you agree to my terms (especially the money part), send me a whatsapp message

0 eight 0 three five 1 three eight 8 one 8.
Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 7:49am On Oct 04
*CSS - SYNTAX 2*

*The Child Selectors*
You have seen the descendant selectors. There is one more type of selector, which is very similar to descendants but have different functionality. Consider the following example:

body > p {color: #000000;}


This rule will render all the paragraphs in black if they are a direct child of the <body> element. Other paragraphs put inside other elements like <div> or <td> would not have any effect of this rule.

*The Attribute Selectors*
You can also apply styles to HTML elements with particular attributes. The style rule below will match all the input elements having a type attribute with a value of text:

input[type=”text”] {color: #000000;}


The advantage to this method is that the <input type="submit" /> element is unaffected, and the color applied only to the desired text fields.

The following are rules applied to attribute selector.

p[lang] - Selects all paragraph elements with a lang attribute.
p[lang="fr"] - Selects all paragraph elements whose lang attribute has a value of exactly "fr".
p[lang~="fr"] - Selects all paragraph elements whose lang attribute contains the word "fr".
p[lang|="en"] - Selects all paragraph elements whose lang attribute contains values that are exactly "en", or begin with "en-".

*Multiple Style Rules*
You may need to define multiple style rules for a single element. You can define these rules to combine multiple properties and corresponding values into a single block as defined in the following example:

h1 {
color:#36C;
font-weight: normal
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}

Here all the property and value pairs are separated by a semicolon ( ; ). You can keep them in a single line or multiple lines. For better readability, we keep them in separate lines. For a while, don't bother about the properties mentioned in the above block. These properties will be explained in the coming chapters and you can find the complete detail about properties studying CSS References.

*Grouping Selectors*
You can apply a style to many selectors if you like. Just separate the selectors with a comma, as given in the following example:

h1, h2, h3 {
color:#36C;
font-weight: normal
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}


This define style rule will be applicable to h1, h2 and h3 element as well. The order of the list is irrelevant. All the elements in the selector will have the corresponding declarations applied to them. You can combine the various ID selectors together as shown below:

#content, #footer, #supplement {
position: absolute;
left: 510px;
width: 200px;
}


Here is a comprehensive example with result shown in images uploaded below. Notice the difference between using the child selector in this example and using the descendant selector in the example from the last lesson. Descendant selector 'selects' any child, grand-child, great grand-child of that element that the selector points to. However you can see here that the child selector only 'selects' the child elements pointed to - like the em child-element of the up tag in our example below is selected by the 'ul > em' but the em element inside the li tag is not selected because it not a child element of the ul tag, it is a grand-child element.

Please carefully observe this two examples, you will get a better understanding.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 9:47pm On Oct 04
*CSS - COLOURS*

CSS uses color values to specify a color. Typically, these are used to set a color either for the foreground of an element (i.e., its text) or for the background of the element. They can also be used to affect the color of borders and other decorative effects. You can specify your color values in various formats. The following image uploaded displays a table list of all the possible formats:

1) keywords or color names e.g black, purple.
2) HEX code e.g #000000, #ffaaff.
3) short HEX e.g #000, #faf.
4) RGB % e.g rgb(50%,50%,0%), rgb(0%,10%,80%).
5) RGB absolute e.g rgb(0,0,0), rgb(40,90,255).

Study our lesson(s) on HTML - COLOURS to better refresh your memory. Thank you.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 8:19pm On Oct 05
*CSS - BACKGROUNDS 1*

This lesson teaches you how to set backgrounds of various HTML elements. You can set the following background properties of an element:

1) The background-color property is used to set the background color of an element.

2) The background-image property is used to set the background image of anelement.

3) The background-repeat property is used to control the repetition of an image in the background.

4) The background-position property is used to control the position of an image inthe background.

5) The background-attachment property is used to control the scrolling of animage in the background.

6) The background property is used as a shorthand to specify a number of other background properties.

*Set the Background Color*
Following is the example, which demonstrates how to set the background color for an element.


.
.
.
<div style=”background-color:yellow;”>
This text has a yellow background color.
</div>
.
.
.


Check out the example uploaded below.

*Set the Background Image*

.
.
.
<table style=”background-image:url(/images/pattern1.gif);”>
<tr><td>This table has a background image set.</td></tr>
</table>
.
.
.


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 1:54pm On Oct 06
*CSS - BACKGROUNDS 2*

*Repeat the Background Image*
The following example demonstrates how to repeat the background image if an image is small. You can use no-repeat value for the background-repeat property if you don't want to repeat an image. In this case, the image will display only once.

By default, the background-repeat property will have a repeat value.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-repeat: repeat;”>
<tr><td>This table has a background image set which will repeat multiple times.</td></tr></table>
.
.
.


The following example which demonstrates how to repeat the background image vertically.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-repeat: repeat-y;”>
<tr><td>This table has a background image set which will repeat vertically.</td></tr>
</table>
.
.
.


The following example demonstrates how to repeat the background image horizontally.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-repeat: repeat-x;”>
<tr><td>This table has a background image set which will repeat horizontally.</td></tr>
</table>
.
.
.


The following example demonstrates how to not repeat the background image at all.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-repeat: repeat-x;”>
<tr><td>This table has a background image set which will repeat horizontally.</td></tr>
</table>
.
.
.


*Set the Background Image Position*
The following example demonstrates how to set the background image position 100 pixels away from the left side.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-position: 100px;”>
<tr><td>Background image positioned 100px away from the left.</td></tr>
</table>
.
.
.


The following example demonstrates how to set the background image position 100 pixels away from the left side and 200 pixels down from the top.

.
.
.
<table style=”background-image:url(/images/pattern1.gif); background-position: 100px 200px;”>
<tr><td>This table has background image positioned 100px away from the left and 200px away from the top.</td></tr>
</table>
.
.
.


You can also use pre-defined values like top, left, right, bottom. See the example uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 6:00pm On Oct 06
*CSS - BACKGROUNDS 3*

*Set the Background Attachment*
Background attachment determines whether a background image is fixed or scrolls with the rest of the page. The following example demonstrates how to set the fixed background image:

.
.
.
<p style=”background-image:url(pattern1.gif); background-attachment: fixed;”>
This paragraph has a fixed background image.</p>
.
.
.


The following example demonstrates how to set the scrolling background image.

.
.
.
<p style=”background-image:url(pattern1.gif); background-attachment: scroll;”>
This paragraph has a scrolling background image.</p>
.
.
.


*Shorthand Property*
You can use the background property to set all the background properties at once. For example:

.
.
.
<p style=”background:url(pattern1.gif) repeat fixed 100px 50px;”>
This paragraph has a fixed repeated background image.</p>
.
.
.


See example uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 8:44pm On Oct 08
*CSS─ FONTS*

This chapter teaches you how to set fonts of a content, available in an HTML element. You can set the following font properties of an element:

The font-family property is used to change the face of a font, possible values could be any font family name.

The font-style property is used to make a font italic or oblique, possible values are normal, italic and oblique.

The font-variant property is used to create a small-caps effect, possible values are normal and small-caps.

The font-weight property is used to increase or decrease how bold or light a font appears; it provides the functionality to specify how bold a font is. Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900.

The font-size property is used to increase or decrease the size of a font i.e. control the size of fonts. Possible values could be xx-small, xsmall, small, medium, large, x-large, xx-large, smaller, larger, size in numbered pixels, centimetres, or %.

The font property is used as shorthand to specify a number of other font properties.

Below is a complete example uploaded - self-explanatory.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 8:44am On Oct 09
*CSS─ TEXT*

This chapter of our lessons teaches you how to manipulate text using CSS properties. You can set the following text properties of an element:

The color property is used to set the color of a text.

The direction property is used to set the text direction, possible values could be rtl (i.e. from right to left) or ltr (i.e. from left to right).

The letter-spacing property is used to add or subtract space between the letters that make up a word.

The word-spacing property is used to add or subtract space between the words of a sentence.

The text-indent property is used to indent the text of a paragraph, specifies the indentation of the first line of a text.

The text-align property is used to align the text of a document.

The text-decoration property is used to underline, overline, and line-through text.

The text-transform property is used to capitalize text or convert text touppercase or lowercase letters.

The white-space property is used to control the flow and formatting of text, possible values could be normal, nowrap, pre, pre-line, pre-wrap, initial, inherit.

The text-shadow property is used to set the text shadow around a text.

The line-height property is used to specify the space between lines.

*Set the Text Color, Text Cases and Text Shadow*
The example below demonstrates how to set the text color, text case and shadow around a text. Possible value for text color could be any color name in any valid format.Possible values for text cases are none, capitalize, uppercase, lowercase. Setting text shadow may not be supported by all the browsers.

*Set the Text Alignment and Decorating the Text*
The example also shows how to align a text and decorate a text. Possible values for alignment are left, right, center, justify. Possible values for decoration are none,underline, overline, line-through, blink.


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>
</head>
<body>

<p style="color: blue; word-spacing: 10px;">This text will have a blue colour and word-spacing.</p><br/>

<p style="direction: rtl;">This text prints from right to left.</p><br/>

<p style="letter-spacing: 12px; line-height: 2.5;">This text has letter-spacing and line-height of 2.5.</p><br/>

<p style="text-align: right; text-transform: capitalize;">This text will be right aligned and capitalized.</p><br/>

<p style="text-align: center; text-transform: uppercase;">This text will be center aligned and set to uppercase.</p><br/>

<p style="text-align: left; text-decoration: overline;">This text will be left aligned and have an overline.</p><br/>

<p style="text-decoration: underline; text-indent: 40px;">This text will be underlined and indented 40px.</p><br/>

<p style="text-decoration: line-through; text-shadow: 3px 2px 2px red;">This text will be striked through and with a shadow.</p>

</body>
</html>

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 7:30pm On Oct 09
*CSS─ IMAGES*

Images play an important role in any webpage. Though it is not recommended to include a lot of images, but it is still important to use good images wherever required. CSS plays a good role to control image display. You can set the following image properties using CSS.

1) The border property is used to set the width of an image border. This property can have a value in length or in %. A width of zero pixels means no border.

2) The height property is used to set the height of an image. It can have a value in length or in %.

3) The width property is used to set the width of an image. This property can have a value in length or in %.

4) The -moz-opacity property is used to set the opacity of an image. This property is used to create a transparent image in Mozilla. Internet Exporer uses filter:alpha(opacity=x) to create transparent images. In Mozilla (-moz-opacity:x), x can be a value from 0.0 - 1.0. A lower value makes the element more transparent (the same things goes for the CSS3-valid syntax opacity:x). In Internet Explorer (filter:alpha(opacity=x)), x can be a value from 0 - 100. A lower value makes the element more transparent. Newer browsers however allow 'opacity'.

5) The border-radius property can be used to set radius for the borders, to make round borders and circle images. To make circle images, set both the width and height to the same value, then border-radius to 50% or 50em.

While giving value in %, it applies in respect of the box in which an image is available.

Here is an example with the results shown in the uploaded image below:


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>
</head>
<body>

<img style="border: 1px solid red; height: 500px; width: 500px; border-radius: 50%;" src="image.jpg"/>

<img src="image.jpg" style="height: 500px; width: 500px; opacity: 0.4;
    filter: alpha(opacity=40);" />

</body>
</html>

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 2:07pm On Oct 11
*CSS─ LINKS*

This chapter of our lessons teaches you how to set different properties of a hyper link using CSS. You can set the following properties of a hyperlink:

The :link signifies unvisited hyperlinks.

The :visited signifies visited hyperlinks.

The :hover signifies an element that currently has the user's mouse pointer hovering over it.

The :active signifies an element on which the user is currently clicking.

Usually, all these properties are kept in the header part of the HTML document.
Remember a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective. Also, a:active MUST come after a:hover in the CSS definition as follows:


<style type=”text/css”>
a:link {color: #000000}
a:visited {color: #006600}
a:hover {color: #FF00CC}
a:active {color: #FF00CC}
</style>


Now, we will see how to use these properties to give different effects to hyperlinks.

*Set the Color of Links, Visited Links, Links On Mouse Over and Active Links*
The following example demonstrates how to set the link color, color of the visited link, change the color of links when we bring a mouse pointer over that link and change the color of the active links. Possible values could be any color name in any valid format.

Example:


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
div {background-color: yellow; padding-left: 21%; font-size: 40px;}
a:link {text-decoration: none; padding: 12px; color: #000000;}
a:visited {color: #006600;}
a:hover {color: #FF00CC; background-color: white;}
a:active {color: #FF00CC;}
</style>

</head>
<body>

<div>
<a href="index.html"> Home </a>
<a href="messages.html"> Messages </a>
<a href="contact.html"> Contact </a>
</div>

</body>
</html>


The html document above is a file named "index.html", which is the Home page as you can see in the home link of page. Aside it, are two other links to two different pages: one named "messages.html", the other "contact.html" for both Messages and Contact pages respectively. Each of these two pages will also have the same code as the one written above for the Home page and all located in the same folder in order for those links to work. They will all therefore produce the same result as seen in the image uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 2:52pm On Oct 11
*CSS─ TABLES 1*

This chapter of our lessons teaches you how to set different properties of an HTML table using CSS. You can set the following properties of a table:

The border-collapse specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.

The border-spacing specifies the width that should appear between table cells.

The caption-side captions are presented in the <caption> element. By default, these are rendered above the table in the document. You use the caption-side property to control the placement of the table caption.

The empty-cells specifies whether the border should be shown if a cell is empty.

The table-layout allows browsers to speed up the layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.

Now, we will see how to use these properties with examples.

*The border-collapse Property*
This property can have two values: collapse and separate. By default, it is set to separate. Try using both values for this example:


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
table.one {border-collapse: collapse;}
td.a {
border-style: dotted;
border-width: 3px;
border-color: #000000;
padding: 10px;
}
td.b {border-style: solid;
border-width: 3px;
border-color: #333333;
padding: 10px;
}
</style>

</head>
<body>

<table class="one">
<caption>Collapse Border Example</caption>
<tr>
<td class="a"> Cell A Collapse Example</td>
<td class="a"> Cell B Collapse Example</td>
</tr>
<tr>
<td class="b"> Cell C Collapse Example</td>
<td class="a"> Cell D Collapse Example</td>
</tr>
</table>

</body>
</html>


The first image uploaded below shows the result of using separate which is also the default, the second image shows the result of using collapse.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 7:52pm On Oct 12
*CSS─ TABLES 2*

*The border-spacing Property*
The border-spacing property specifies the distance that separates the adjacent cells' borders. It can take either one or two values; these should be units of length. If you provide one value, it applies to both vertical and horizontal borders. Or you can specify two values, in which case, the first refers to the horizontal spacing and the second to the vertical spacing:

NOTE: Unfortunately, this property does not work in Netscape 7 or IE 6.

<style type="text/css">
/* If you provide one value */
table.example {border-spacing:10px;}
/* This is how you can provide two values */
table.example {border-spacing:10px 15px;}
</style>

Now let's modify the previous example and see the effect:


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
table.one {
border-collapse: separate;
width: 900px;
border-spacing: 10px;
}

table.two {
border-collapse: separate;
width: 900px;
border-spacing: 10px 50px;
}

caption {
font-weight: bold;
}
</style>

</head>
<body>

<table class="one" border="1">
<caption>Separate Border Example with border-spacing 100px all sides</caption>
<tr>
<td> Cell A Collapse Example</td>
<td> Cell B Collapse Example</td>
<td> Cell C Collapse Example</td>
</tr>
<tr>
<td> Cell D Collapse Example</td>
<td colspan="2"> Cell E Collapse Example</td>
</tr>
</table>
<br />
<table class="two" border="1">
<caption>Separate Border Example with border-spacing with 10px top & bottom, 50px right & left</caption>
<tr>
<td> Cell A Collapse Example</td>
<td> Cell B Collapse Example</td>
<td> Cell C Collapse Example</td>
</tr>
<tr>
<td> Cell D Collapse Example</td>
<td colspan="2"> Cell E Collapse Example</td>
</tr>
</table>

</body>
</html>


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 8:20pm On Oct 12
CSS─ TABLES 3*

*The empty-cells Property*
The empty-cells property indicates whether a cell without any content should have a border displayed. This property can have one of the three values - show, hide, or inherit. Here is the empty-cells property used to hide borders of empty cells in the <table> element.


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
table.empty {
width: 350px;
border-collapse: separate;
empty-cells: hide;
}

td.empty {
padding: 5px;
border-style: solid;
border-width: 1px;
border-color: #999999;
}
</style>

</head>
<body>

<table class="empty">
<tr>
<th></th>
<th>Title one</th>
<th>Title two</th>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty">value</td>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty"></td>
</tr>
</table>

</body>
</html>


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by Albertone(m): 10:59pm On Oct 12
geektechlife:
CSS─ TABLES 3*

*The empty-cells Property*
The empty-cells property indicates whether a cell without any content should have a border displayed. This property can have one of the three values - show, hide, or inherit. Here is the empty-cells property used to hide borders of empty cells in the <table> element.


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
table.empty {
width: 350px;
border-collapse: separate;
empty-cells: hide;
}

td.empty {
padding: 5px;
border-style: solid;
border-width: 1px;
border-color: #999999;
}
</style>

</head>
<body>

<table class="empty">
<tr>
<th></th>
<th>Title one</th>
<th>Title two</th>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty">value</td>
</tr>
<tr>
<th>Row Title</th>
<td class="empty">value</td>
<td class="empty"></td>
</tr>
</table>

</body>
</html>


Powered by Programmers Community...


Sir Please!I have a css question about pseudo-classes.Basically I got stuck.

Can I go ahead to post the question with a picture of my code and result where I got stuck??
Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 12:00am On Oct 13
Albertone:


Sir Please!I have a css question about pseudo-classes.Basically I got stuck.

Can I go ahead to post the question with a picture of my code and result where I got stuck??

Ofcourse, please do.
Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 12:01am On Oct 13
*CSS─ TABLES 4*

*The table-layout Property*
The table-layout property is supposed to help you control how a browser should render or lay out a table. This property can have one of the three values: fixed, auto, or inherit. The following example shows the difference between these properties.

NOTE: This property is not supported by many browsers, so do not rely on this property.


<!DOCTYPE html>
<html>
<head>
<title>HTML CSS</title>

<style type="text/css">
table.auto
{
table-layout: auto
}
table.fixed
{
table-layout: fixed
}
</style>

</head>
<body>

<table class="auto" border="1">
<tr>
<th></th>
<th>Title one</th>
<th>Title two</th>
</tr>
<tr>
<th>Row Title</th>
<td>value</td>
<td>value</td>
</tr>
<tr>
<th>Row Title</th>
<td>value</td>
<td></td>
</tr>
</table>

<br/><br/>

<table class="fixed" border="1">
<tr>
<th></th>
<th>Title one</th>
<th>Title two</th>
</tr>
<tr>
<th>Row Title</th>
<td>value</td>
<td>value</td>
</tr>
<tr>
<th>Row Title</th>
<td>value</td>
<td></td>
</tr>
</table>

</body>
</html>


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by Albertone(m): 9:22pm On Oct 13
geektechlife:


Ofcourse, please do.
Any text-decoration I use on the a:link will also be the one to be applied in the a:visited despite me specifying a different rule for the a:visited.

Using the example below,the a:visited is supposed to be overlined.But because a:link has a 'none' text-decoration rule,the a:visited too took on the 'none' rule instead of 'overline' rule.

NB:It doesn't happen to other properties i.e Font-weight,font-style,font-size etc.It only happens to 'text-decoration'.


Please what can I do?

2 Likes

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 10:16pm On Oct 14
*CSS─ BORDERS 1*

Border: The border properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change:
The border-color specifies the color of a border.
The border-style specifies whether a border should be solid, dashed line, double line, or one of the other possible values.
The border-width specifies the width of a border.

Now, we will see how to use these properties with examples.

*The border-color Property*
The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties:
border-bottom-color changes the color of bottom border.
border-top-color changes the color of top border.
border-left-color changes the color of left border.
border-right-color changes the color of right border.

The following example shows the effect of all these properties:


<!DOCTYPE html>
<html>
<head>
<title> CSS Borders </title>

<style type="text/css">
p.example1{
border:1px solid;
border-bottom-color:#009900; /* Green */
border-top-color:#FF0000; /* Red */
border-left-color:#330000; /* Black */
border-right-color:#0000CC; /* Blue */
}
p.example2 {
border:1px solid;
border-color:#009900; /* Green */
}
</style>

</head>
<body>

<p class="example1"> All borders in different colors. </p>

<p class="example2"> All borders in one color. </p>

</body>
</html>


*The border-style Property*
The border-style property allows you to select one of the following styles of border:
none: No border. (Equivalent of border-width:0wink
solid: Border is a single solid line.
dotted: Border is a series of dots.
dashed: Border is a series of short lines.
double: Border is two solid lines.
groove: Border looks as though it is carved into the page.
ridge: Border looks the opposite of groove.
inset: Border makes the box look like it is embedded in the page.
outset: Border makes the box look like it is coming out of the canvas.
hidden: Same as none, except in terms of border-conflict resolution for table elements.

You can individually change the style of the bottom, left, top, and right borders of an element using the following properties:
border-bottom-style changes the style of bottom border.
border-top-style changes the style of top border.
border-left-style changes the style of left border.
border-right-style changes the style of right border.

The following example shows all these border styles:


<!DOCTYPE html>
<html>
<head>
<title> CSS Borders </title>
</head>
<body>

<p style="border-width: 4px; border-style: solid;"> This is a solid border. </p>

<p style="border-width: 4px; border-style: dashed;"> This is a dashed border. </p>

<p style="border-width: 4px; border-style: double;"> This is a double border. </p>

<p style="border-width: 4px; border-style: groove;"> This is a groove border. </p>

<p style="border-width: 4px; border-style: ridge"> This is a ridge border. </p>

<p style="border-width: 4px; border-style: inset;"> This is a inset border. </p>

<p style="border-width: 4px; border-style: outset;"> This is a outset border. </p>

<p style="border-width: 4px; border-style: hidden;"> This is a hidden border. </p>

<p style="border-width:4px; border-top-style: solid; border-bottom-style: dashed; border-left-style: groove; border-right-style: double;"> This is a a border with four different styles. </p>

</body>
</html>


See the results uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 10:59pm On Oct 14
Albertone:
Any text-decoration I use on the a:link will also be the one to be applied in the a:visited despite me specifying a different rule for the a:visited.

Using the example below,the a:visited is supposed to be overlined.But because a:link has a 'none' text-decoration rule,the a:visited too took on the 'none' rule instead of 'overline' rule.

NB:It doesn't happen to other properties i.e Font-weight,font-style,font-size etc.It only happens to 'text-decoration'.


Please what can I do?

That's true. However, a quick solution is to use border property instead of text-decoration. Use border-top or border-bottom. It works.

1 Like

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 6:00pm On Oct 15
CSS─ BORDERS 2*

*The border-width Property*
The border-width property allows you to set the width of an element borders. The value of this property could be either a length in px, pt, or cm, or it should be set to thin, medium, or thick. You can individually change the width of the bottom, top, left, and right borders of an element using the following properties:
border-bottom-width changes the width of bottom border.
border-top-width changes the width of top border.
border-left-width changes the width of left border.
border-right-width changes the width of right border.
The following example show all these border width:


<!DOCTYPE html>
<html>
<head>
<title>CSS BORDERS</title>
</head>
<body>

<p style="border-width:4px; border-style:solid;">
This is a solid border whose width is 4px.
</p>
<p style="border-width:4pt; border-style:solid;">
This is a solid border whose width is 4pt.
</p>
<p style="border-width:thin; border-style:solid;">
This is a solid border whose width is thin.
</p>
<p style="border-width:medium; border-style:solid;">
This is a solid border whose width is medium;
</p>
<p style="border-width:thick; border-style:solid;">
This is a solid border whose width is thick.
</p>
<p style="border-bottom-width:4px;border-top-width:10px;border-left-width: 2px;border-right-width:15px;border-style:solid;">
This is a border with four different width.</p>

</body>
</html>


Result shown in first image uploaded below.

*Border Properties Using Shorthand*
The border property allows you to specify color, style, and width of lines in one property:
The following example shows how to use all the three properties into a single property.
This is the most frequently used property to set border around any element.


<!DOCTYPE html>
<html>
<head>
<title>CSS BORDERS</title>
</head>
<body>

<p style="border:4px ridge red;">
This example is showing shorthand property for border.
</p>
<p style="border:medium dashed #889;">
This example is showing shorthand property for border.
</p>

</body>
</html>


Result shown in second image uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by Albertone(m): 8:04pm On Oct 15
geektechlife:


That's true. However, a quick solution is to use border property instead of text-decoration. Use border-top or border-bottom. It works.

Thanks,I will try that!
Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 9:49am On Oct 16
*CSS─ MARGINS*

The margin property defines the space around an HTML element; you can say the from the element border to any other surrounding elements. It is possible to use negative values to overlap content.

The values of the margin property are not inherited by the child elements. Remember that the adjacent vertical margins (top and bottom margins) will collapse into each other so that the distance between the blocks is not the sum of the margins, but only the greater of the two margins or the same size as one margin if both are equal. We have the following properties to set an element margin.

1) The margin specifies a shorthand property for setting the margin properties in one declaration.

2) The margin-bottom specifies the bottom margin of an element.

3) The margin-top specifies the top margin of an element.

4) The margin-left specifies the left margin of an element.

5) The margin-right specifies the right margin of an element.

Now, we will see how to use these properties with examples.

*The Margin Property*
The margin property allows you to set all of the properties for the four margins in one declaration. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title>CSS MARGINS</title>
</head>
<body>

<p style="margin: 15px; border:1px dotted black;"> all four margins will be 15px. </p>
<br/>

<p style="margin:10px 2%; border:1px outset black;"> top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document. </p>
<br/>

<p style="margin: 10px 2% -10px; border:1px solid black;"> top margin will be 10px, left and right margin will be 2% of the total width of the document, bottom margin will be -10px. </p>
<br/>

<p style="margin: 10px 2% -10px auto; border:1px dashed black;"> top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser. </p>

</body>
</html>


You'd notice that when there is just one value, all sides use it. When there are two values, top and bottom use the first, right and left use the second. With three values, the top take the first, right and left take the second, leaving the third value as bottom margin. And when the values are four, first goes for top, second goes for right, third goes for bottom, last goes for left. That is it runs in a clockwise direction. This applies also for padding.

*The margin-bottom, margin-top, margin-left and margin-right Properties*
The margin-bottom property allows you to set the bottom margin of an element. The margin-top property allows you to set the top margin of an element. The margin-left property allows you to set the left margin of an element. The margin-right property allows you to set the right margin of an element. There can each have a value in length, %, or auto. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title>CSS MARGINS</title>
</head>
<body>

<p style="margin-bottom: 15px; border:4px outset black;">
This is a paragraph with a specified bottom margin.
</p>
<br/>

<p style="margin-top: 5%; border:4px solid black;">
This is a paragraph with a specified top margin in percent.
</p>
<br/>

<p style="margin-left: 15px; border:4px inset black;">
This is a paragraph with a specified left margin.
</p>
<br/>

<p style="margin-right: 5%; border:4px ridge black;">
This is a paragraph with a specified right margin in percent.
</p>

</body>
</html>


See results accordingly in first and second images uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 2:08pm On Oct 17
*CSS─ PADDINGS*

The padding property allows you to specify how much space should appear between the content of an element and its border. The value of this attribute should be either a length, a percentage, or the word inherit. If the value is inherit, it will have the same padding as its parent element. If a percentage is used, the percentage is of the containing box. The following CSS properties can be used to control lists. You can also set different values for the padding on each side of the box using the following properties:

1) The padding-bottom specifies the bottom padding of an element.

2) The padding-top specifies the top padding of an element.

3) The padding-left specifies the left padding of an element.

4)The padding-right specifies the right padding of an element.

5) The padding serves as shorthand for the preceding properties.

Now, we will see how to use these properties with examples.

*The padding-bottom, padding-top, padding-left and padding-right Properties*
The padding-bottom property sets the bottom padding (space) of an element. The padding-top property sets the top padding (space) of an element. The padding-left property sets the left padding (space) of an element. The padding-right property sets the right padding (space) of an element. These can each take a value in terms of length or %.
Here is an example:


<!DOCTYPE html>
<html>
<head>
<title>CSS PADDINGS</title>
</head>
<body>

<p style="padding-bottom: 15px; border:1px solid black;">
This is a paragraph with a specified bottom padding</p>
<br/>

<p style="padding-top: 5%; border:1px solid black;">This is a paragraph with a specified top padding in percent</p>
<br/>

<p style="padding-left: 15px; border:1px solid black;">
This is a paragraph with a specified left padding</p>
<br/>

<p style="padding-right: 5%; border:1px solid black;">
This is a paragraph with a specified right padding in percent</p>

</body>
</html>


*The Padding Property*
The padding property sets the left, right, top and bottom padding (space) of an element. This can take a value in terms of length or %.
Here is an example:


<!DOCTYPE html>
<html>
<head>
<title>CSS PADDINGS</title>
</head>
<body>

<p style="padding: 15px; border:1px solid black;">
all four padding will be 15px
</p>
<br/>

<p style="padding:10px 2%; border:1px solid black;">
top and bottom padding will be 10px, left and right padding will be 2% of the
total width of the document.
</p>
<br/>

<p style="padding: 10px 2% 10px; border:1px solid black;">
top padding will be 10px, left and right padding will be 2% of the total width
of the document, bottom padding will be 10px
</p>
<br/>

<p style="padding: 10px 2% 10px 10px; border:1px solid black;">
top padding will be 10px, right padding will be 2% of the total width of the
document, bottom padding and top padding will be 10px
</p>

</body>
</html>


Results are shown in the images uploaded below. Check the examples on margin. See how padding works different from margin?

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 4:26pm On Oct 17
*CSS─ LISTS 1*

Lists are very helpful in conveying a set of either numbered or bulleted points. You will learn how to control list type, position, style, etc., using CSS. We have the following five CSS properties, which can be used to control lists:

1) The list-style-type allows you to control the shape or appearance of the marker.

2) The list-style-position specifies whether a long point that wraps to a second line should align with the first line or start underneath the start of the marker.

3) The list-style-image specifies an image for the marker rather than a bullet point or number.

4) The list-style serves as shorthand for the preceding properties.

5) The marker-offset specifies the distance between a marker and the text in the list.

Now we will see how to use these properties with examples.

*The list-style-type Property*
The list-style-type property allows you to control the shape or style of a bullet point (also known as a marker) in case of unordered lists and the style of numbering characters in ordered lists.

Here are the values, which can be used for an unordered list:

1) none - gives no marker.
2) disc - (default) gives a filled-in circle.
3) circle - gives an empty circle.
4) square - gives a filled-in square.

Here are the values, which can be used for an ordered list:

1) decimal - gives a number marker e.g "1".

2) decimal-leading-zero - gives a number marker with a preceding zero e.g "01".

3) lower-alpha - gives an alphabet marker in lowercase e.g "a".

4) upper-alpha - gives an alphabet marker in uppercase e.g "A".

5) lower-roman - gives a Roman numeric marker in lowercase e.g "i".

6) upper-roman - gives a Roman numeric marker in uppercase e.g "I".

Here is an example, and the result shown in the image uploaded below:


<!DOCTYPE html>
<html>
<head>
<title>CSS LISTS</title>
</head>
<body style="padding: 10px;">

<h1> UNORDERED LISTS </h1>
<ul style="list-style-type: none;">
<li>Maths</li>
<li>Social Science</li>
</ul>
<br/>

<ul style="list-style-type: disc;">
<li>Maths</li>
<li>Social Science</li>
</ul>
<br/>

<ul style="list-style-type: circle;">
<li>Maths</li>
<li>Social Science</li>
</ul>
<br/>

<ul style="list-style-type: square;">
<li>Maths</li>
<li>Social Science</li>
</ul>
<br/>

<h1> ORDERED LISTS </h1>
<ol style="list-style-type: decimal;">
<li>Maths</li>
<li>Social Science</li>
</ol>
<br/>

<ol style="list-style-type: lower-alpha;">
<li>Maths</li>
<li>Social Science</li>
</ol>
<br/>

<ol style="list-style-type: upper-alpha;">
<li>Maths</li>
<li>Social Science</li>
</ol>
<br/>

<ol style="list-style-type: lower-roman;">
<li>Maths</li>
<li>Social Science</li>
</ol>
<br/>

<ol style="list-style-type: upper-roman;">
<li>Maths</li>
<li>Social Science</li>
</ol>

</body>
</html>


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by geektechlife: 3:40pm On Oct 18
CSS─ LISTS 2*

*The list-style-image Property*
The list-style-image allows you to specify an image so that you can use your own bullet style. The syntax is similar to the background-image property with the letters url starting the value of the property followed by the URL in brackets. If it does not find the given image then default bullets are used. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title>CSS LISTS</title>
</head>
<body style="padding: 10px;">

<h1> UNORDERED LIST </h1>
<ul>
<li style="list-style-image: url(let.jpeg);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<h1> ORDERED LIST </h1>
<ol>
<li style="list-style-image: url(let.jpeg);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

</body>
</html>


*The list-style Property*
The list-style allows you to specify all the list properties into a single expression. These properties can appear in any order.

*The marker-offset Property*
The marker-offset property allows you to specify the distance between the marker and the text relating to that marker. Its value should be a length as shown in the following example. Unfortunately, this property is not supported in IE 6 or Netscape 7. Here is the example:


<!DOCTYPE html>
<html>
<head>
<title>CSS LISTS</title>
</head>
<body style="padding: 10px;">

<h1> UNORDERED LIST </h1>
<ul style="list-style: inside square; marker-offset: 2em;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<h1> ORDERED LIST </h1>
<ol style="list-style: outside upper-alpha; marker-offset: 2cm;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

</body>
</html>


Result is shown in the image uploaded below.

Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 5:17pm
*CSS─ DIMENSIONS 1*

You have seen the border that surrounds every box i.e. element, the padding that can appear inside each box, and the margin that can go around them. Now you will learn how to change the dimensions of boxes. We have the following properties that allow you to control the dimensions of a box.

The line-height property is used to set the height of a line of text.

The height property is used to set the height of a box.

The width property is used to set the width of a box.

The max-height property is used to set a maximum height that a box can be.

The min-height property is used to set the minimum height that a box can be.

The max-width property is used to set the maximum width that a box can be.

The min-width property is used to set the minimum width that a box can be.

*The line-height Property*
The line-height property allows you to increase the space between lines of text. The value of the line-height property can be a number, a length, or a percentage.

*The Height and Width Properties*
The height and width properties allow you to set the height and width for boxes. They can take values of a length, a percentage, or the keyword 'auto'.

Here is an example with the result shown in the image uploaded below.


<!DOCTYPE html>
<html>
<head>
<title> CSS DIMENSIONS </title>
</head>
<body style="padding: 10px;">

<p style="border: 1px solid red; padding: 5px; margin: 10px;"> This paragraph has no set width, height or line height. <br/> See its difference from the next paragraph. </p>

<p style="width: 400px; height: 100px; border: 1px solid red; padding: 5px; margin: 10px; line-height: 30px;"> This paragraph is 400 pixels wide and 100 pixels high and here line height is 30 pixels. </p>

</body>
</html>


Powered by Programmers Community...

2 Shares

Re: I Want To Build Websites All By Myself. Can I? by eesyy(m): 8:22pm
*CSS─ DIMENSIONS 2*

*The max-height Property*
The max-height property allows you to specify the maximum height of a box. The value of the max-height property can be a number, a length, or a percentage. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title> CSS DIMENSIONS </title>
</head>
<body style="padding: 10px;">

<p style="width: 400px; max-height: 10px; border: 1px solid red;
padding: 5px; margin: 10px;">
This paragraph is 400px wide and max height is 10px. <br/>
This paragraph is 400px wide and max height is 10px. <br/>
This paragraph is 400px wide and max height is 10px.
</p>

<img alt="logo" src="fg.png" width="100px" height="100px" />

</body>
</html>


*The min-height Property*
The min-height property allows you to specify the minimum height of a box. The value of the min-height property can be a number, a length, or a percentage. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title> CSS DIMENSIONS </title>
</head>
<body style="padding: 10px;">

<p style="width: 400px; min-height: 200px; border: 1px solid red; padding: 5px; margin: 10px;">
This paragraph is 400px wide and min height is 200px. <br/>
This paragraph is 400px wide and min height is 200px. <br/>
This paragraph is 400px wide and min height is 200px.
</p>

<img alt="logo" src="fg.png" width="100px" height="100px" />

</body>
</html>


*The max-width Property*
The max-width property allows you to specify the maximum width of a box. The value of the max-width property can be a number, a length, or a percentage. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title> CSS DIMENSIONS </title>
</head>
<body style="padding: 10px;">

<p style="max-width: 100px; height:200px; border:1px solid red;
padding: 5px; margin: 10px;">
This paragraph is 200px high and max width is 100px. <br/>
This paragraph is 200px high and max width is 100px. <br/>
This paragraph is 200px high and max width is 100px.
</p>

<img alt="logo" src="fg.png" width="100px" height="100px" />

</body>
</html>


*The min-width Property*
The min-width property allows you to specify the minimum width of a box. The value of the min-width property can be a number, a length, or a percentage. Here is an example:


<!DOCTYPE html>
<html>
<head>
<title> CSS DIMENSIONS </title>
</head>
<body style="padding: 10px;">

<p style="min-width: 400px; height: 100px; border: 1px solid red; padding: 5px; margin: 10px;">
This paragraph is 100px high and min width is 400px. <br/>
This paragraph is 100px high and min width is 400px. <br/>
This paragraph is 100px high and min width is 400px.
</p>

<img alt="logo" src="fg.png" width="100px" height="100px" />

</body>
</html>


These four properties do not work in either Netscape 7 or IE 6. Results for the 4 examples are shown in the images uploaded below accordingly.

Powered by Programmers Community...

2 Shares

(1) (2) (3) (4) (Reply)

Download Any Paid Course From Udemy For Free With This Software / How Much Can I Make From MGID With 5 To 7k Traffic / Css Clean-up Tool

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2020 Oluwaseun Osewa. All rights reserved. See How To Advertise. 527
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.