The 'client' is used in client-server environment to refer to the program the person uses to run the application. A client-server environment is one in which multiple computers share information such as entering information into a database. The 'client' is the application used to enter the information, and the 'server' is the application used to store the information.
Continue Reading...
Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts
What is a Client?
Labels:
ADO.Net
,
ASP dot Net
,
C Sharp
,
Computer details
,
CSS
,
DotNet
,
HR
,
PHP
,
SharePoint
,
Tips
All CSS Border Properties and their descriptions
- border: Sets all the border properties in one declaration
- border-bottom: Sets all the bottom border properties in one declaration
- border-bottom-color: Sets the color of the bottom border
- border-bottom-style: Sets the style of the bottom border
- border-bottom-width: Sets the width of the bottom border
- border-color: Sets the color of the four borders
- border-left: Sets all the left border properties in one declaration
- border-left-color: Sets the color of the left border
- border-left-style: Sets the style of the left border
- border-left-width: Sets the width of the left border
- border-right: Sets all the right border properties in one declaration
- border-right-color: Sets the color of the right border
- border-right-style: Sets the style of the right border
- border-right-width: Sets the width of the right border
- border-style:Sets the style of the four borders
- border-top: Sets all the top border properties in one declaration
- border-top-color: Sets the color of the top border
- border-top-style: Sets the style of the top border
- border-top-width: Sets the width of the top border
- border-width: Sets the width of the four borders
CSS Border - Shorthand property
There are many properties to consider when dealing with borders. To shorten the code, it is also possible to specify all the border properties in one property. This is called a shorthand property.The shorthand property for the border properties is "border":
Example
When using the border property, the order of the values are:
It does not matter if one of the values above are missing (although, border-style is required), as long as the rest are in the specified order.
Continue Reading...
Example
border:5px solid red;
When using the border property, the order of the values are:
- border-width
- border-style
- border-color
It does not matter if one of the values above are missing (although, border-style is required), as long as the rest are in the specified order.
CSS Border Color property
The border-color property is used to set the color of the border. The color can be set by:
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.
Example
Continue Reading...
- name - specify a color name, like "red"
- RGB - specify a RGB value, like "rgb(255,0,0)"
- Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.
Example
p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}
CSS Border Width property
The border-width property is used to set the width of the border. The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.
Example
Continue Reading...
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.
Example
p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}
CSS Border Style property
The border-style property specifies what kind of border to display.
border-style values:
Tip: None of the border properties will have any effect unless the border-style property is set!
Continue Reading...
border-style values:
- none: Defines no border
- dotted: Defines a dotted border
- dashed: Defines a dashed border
- solid: Defines a solid border
- double: Defines two borders. The width of the two borders are the same as the border-width value
- groove: Defines a 3D grooved border. The effect depends on the border-color value
- ridge: Defines a 3D ridged border. The effect depends on the border-color value
- inset: Defines a 3D inset border. The effect depends on the border-color value
- outset: Defines a 3D outset border. The effect depends on the border-color value
Tip: None of the border properties will have any effect unless the border-style property is set!
CSS Tables properties
Table Borders
To specify table borders in CSS, use the border property.Example
table, th, td
{
border: 1px solid black;
}
{
border: 1px solid black;
}
Notice that the table in the example above has double borders. This is because both the table, th, and td elements have separate borders.
Collapse Borders
The border-collapse property sets whether the table borders are collapsed into a single border or separated:Example
table
{
table,th, td
{
{
border-collapse:collapse;
}table,th, td
{
border: 1px solid black;
}Table Width and Height
Width and height of a table is defined by the width and height properties.Example
table
{
width:100%;
}
th
{
height:50px;
}
{
width:100%;
}
th
{
height:50px;
}
Table Text Alignment
The text in a table is aligned with the text-align and vertical-align properties. The text-align property sets the horizontal alignment, like left, right, or center:Example
td
{
text-align:right;
}
{
text-align:right;
}
The vertical-align property sets the vertical alignment, like top, bottom, or middle:
Example
td
{
height:50px;
vertical-align:bottom;
}
{
height:50px;
vertical-align:bottom;
}
Table Padding
To control the space between the border and content in a table, use the padding property on td and th elements:Example
td
{
padding:15px;
}
{
padding:15px;
}
Table Color
The example below specifies the color of the borders, and the text and background color of th elements:Example
table, td, th
{
th
{
{
border:1px solid green;
}th
{
background-color:green;
color:white;
}color:white;
All CSS List Properties
| Property | Description |
|---|---|
| list-style | Sets all the properties for a list in one declaration |
| list-style-image | Specifies an image as the list-item marker |
| list-style-position | Specifies if the list-item markers should appear inside or outside the content flow |
| list-style-type | Specifies the type of list-item marker |
The CSS Lists properties
In HTML, there are two types of lists:
The type of list item marker is specified with the list-style-type property:
Example
Example:
Note: The example above does not display equally in all browsers. IE and Opera will display the image-marker a little bit higher than Firefox, Chrome, and Safari.
If you want the image-marker to be placed equally in all browsers, a crossbrowser solution is explained below.
Example
Explaination for above example:
Example
Note: When using the shorthand property, the order of the values are:
Tip: It does not matter if one of the values above are missing, as long as the rest are in the specified order.
Continue Reading...
- unordered lists - the list items are marked with bullets
- ordered lists - the list items are marked with numbers or letters
- Set different list item markers for ordered lists
- Set different list item markers for unordered lists
- Set an image as the list item marker
The type of list item marker is specified with the list-style-type property:
Example
ul.a {list-style-type: circle;}
ul.b {list-style-type: square;}
ol.c {list-style-type: upper-roman;}
ol.d {list-style-type:lower-alpha;}
ul.b {list-style-type: square;}
ol.c {list-style-type: upper-roman;}
ol.d {list-style-type:lower-alpha;}
An Image as The List Item Marker
To specify an image as the list item marker, use the list-style-image property.Example:
ul
{
list-style-image: url('sqpurple.gif');
}
{
list-style-image: url('sqpurple.gif');
}
Note: The example above does not display equally in all browsers. IE and Opera will display the image-marker a little bit higher than Firefox, Chrome, and Safari.
If you want the image-marker to be placed equally in all browsers, a crossbrowser solution is explained below.
Crossbrowser Solution
The following example displays the image-marker equally in all browsers:Example
ul
{
li
{
{
list-style-type: none;
padding: 0px;
margin: 0px;
}padding: 0px;
margin: 0px;
li
{
background-image: url(sqpurple.gif);
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 14px;
}background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 14px;
Explaination for above example:
- For ul:
- Set the list-style-type to none to remove the list item marker
- Set both padding and margin to 0px (for cross-browser compatibility)
- For li:
- Set the URL of the image, and show it only once (no-repeat)
- Position the image where you want it (left 0px and down 5px)
- Position the text in the list with padding-left
List - Shorthand property
It is also possible to specify all the list properties in one, single property. This is called a shorthand property. The shorthand property used for lists, is the list-style property:Example
ul
{
list-style: square url("sqpurple.gif");
}
{
list-style: square url("sqpurple.gif");
}
Note: When using the shorthand property, the order of the values are:
- list-style-type
- list-style-position (for a description, see the CSS properties table below)
- list-style-image
Tip: It does not matter if one of the values above are missing, as long as the rest are in the specified order.
CSS Links and Link Styles
Links can be styled with any CSS property (e.g. color, font-family, background, etc.). Special for links are that they can be styled differently depending on what state they are in.
The four links states are:
Example
Note: When setting the style for several link states, there are some order rules:
Text Decoration
Continue Reading...
The four links states are:
- a:link - a normal, unvisited link
- a:visited - a link the user has visited
- a:hover - a link when the user mouses over it
- a:active - a link the moment it is clicked
Example
a:link {color:#FF0000;} /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
Note: When setting the style for several link states, there are some order rules:
- a:hover MUST come after a:link and a:visited
- a:active MUST come after a:hover
Common Link Styles
In the example above the link changes color depending on what state it is in. Lets go through some of the other common ways to style links:Text Decoration
The text-decoration property is mostly used to remove underlines from links:
Examplea:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}
Background Colora:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}
The background-color property specifies the background color for links.
Examplea:link {background-color:#B2FF99;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}
All CSS Font Properties
| Property | Description | Values |
|---|---|---|
| font | Sets all the font properties in one declaration | font-style font-variant font-weight font-size font-family caption icon menu message-box small-caption status-bar inherit |
| font-family | Specifies the font family for text | font-name generic-family inherit |
| font-size | Specifies the font size of text | xxx-small x-small small medium large x-large xx-large smaller larger % inherit |
| font-style | Specifies the font style for text | normal italic oblique inherit |
| font-variant | Specifies whether or not a text should be displayed in a small caps | normal small-caps inherit |
| font-weight | Specifies the weight of a font | normal bold bolder lighter inherit |
CSS Styling Fonts
CSS font properties define the font family, boldness, size, and the style of a text. In CSS, there are two types of font family names:
The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.Start with the font you want, and end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. More than one font family is specified in a comma-separated list:
Example:
Note: If the name of a font family is more than one word, it must be in quotation marks, like font-family: "Times New Roman".
Tip: On computer screens, sans-serif fonts are considered easier to read than serif fonts.
Example:
The font-size property sets the size of the text. The font-size value can be an absolute, or relative size.
Absolute size:
Relative size:
Continue Reading...
- generic family - a group of font families with a similar look (like "Serif" or "Monospace")
- font family - a specific font family (like "Times New Roman" or "Arial")
Font Family
The font family of a text is set with the font-family property.The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.Start with the font you want, and end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. More than one font family is specified in a comma-separated list:
Example:
- p{font-family:"Times New Roman", Times, serif;}
Note: If the name of a font family is more than one word, it must be in quotation marks, like font-family: "Times New Roman".
Tip: On computer screens, sans-serif fonts are considered easier to read than serif fonts.
Font Style
The font-style property is mostly used to specify italic text. This property has three values:- normal - The text is shown normally
- italic - The text is shown in italics
- oblique - The text is "leaning" (oblique is very similar to italic, but less supported)
Example:
- p.normal {font-style:normal;}
- p.italic {font-style:italic;}
- p.oblique {font-style:oblique;}
The font-size property sets the size of the text. The font-size value can be an absolute, or relative size.
Absolute size:
- Sets the text to a specified size
- Does not allow a user to change the text size in all browsers (bad for accessibility reasons)
- Absolute size is useful when the physical size of the output is known
Relative size:
- Sets the size relative to surrounding elements
- Allows a user to change the text size in browsers
All CSS Text Properties
| Property | Description | Values |
|---|---|---|
| color | Sets the color of text | color |
| direction | Specifies the text direction/writing direction | ltr, rtl |
| letter-spacing | Increases or decreases the space between characters in a text | |
| line-height | Sets the line height | normal, number, length, % |
| text-align | Specifies the horizontal alignment of text | left, right, center, justify |
| text-decoration | Specifies the decoration added to text | none, underline, overline, line-through, blink |
| text-indent | Specifies the indentation of the first line in a text-block | length, % |
| text-shadow | Specifies the shadow effect added to text | none, color, length |
| text-transform | Controls the capitalization of text | none, capitalize, uppercase, lowercase |
| vertical-align | Sets the vertical alignment of an element | baseline, sub, super, top, text-top, middle, bottom, text-bottom, length, % |
| white-space | Specifies how white-space inside an element is handled | normal, pre, nowrap |
| word-spacing | Increases or decreases the space between words in a text | normal, length |
CSS Text
Text Color
The color property is used to set the color of the text. The color property is most often specified by:- a HEX value - like "#ff0000"
- an RGB value - like "rgb(255,0,0)"
- a color name - like "red"
Example:
body {color:navy;}
h1 {color:#00ff00;}
p {color:rgb(255,0,0);}
h1 {color:#00ff00;}
p {color:rgb(255,0,0);}
Text Alignment
The text-align property is used to set the horizontal alignment of a text. The Text can be centered, or aligned to the left or right, or justified.Example:
p.date {text-align:right;}
p.main {text-align:justify;}
p.main {text-align:justify;}
Text Decoration
The text-decoration property is used to set or remove decorations from text.Tip: The text-decoration property is mostly used to remove underlines from links for design purposes.
Example:
a {text-decoration:none;}
Text Transformation
The text-transform property is used to specify uppercase and lowercase letters in a text. It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.Example:
p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}
Text Indentation
The text-indentation property is used to specify the indentation of the first line of a text.Eample:
p {text-indent:50px;}
All CSS background properties and values
| Property | Description | Values |
|---|---|---|
| background | Sets all the background properties in one declaration | background-color background-image background-repeat background-attachment background-position inherit |
| background-attachment | Sets whether a background image is fixed or scrolls with the rest of the page | scroll fixed inherit |
| background-color | Sets the background color of an element | color transparent inherit |
| background-image | Sets the background image for an element | url(URL) none inherit |
| background-position | Sets the starting position of a background image | top left top center top right center left center center center right bottom left bottom center bottom right x% y% x-pos y-pos inherit |
| background-repeat | Sets how a background image will be repeated | repeat repeat-x repeat-y no-repeat inherit |
Background property in CSS
CSS background properties are used to define the background effects of an element.CSS properties used for background effects:
Note:
When using the shorthand property the order of the property values are:
It does not matter if one of the property values is missing, as long as the ones that are present are in this order.
Continue Reading...
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
Note:
When using the shorthand property the order of the property values are:
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
It does not matter if one of the property values is missing, as long as the ones that are present are in this order.
What style will be used when there is more than one style specified for an HTML element?
If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).
Continue Reading...
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
- Browser default
- External style sheet
- Internal style sheet (in the head section)
- Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).
How can we insert a style sheet?
There are three ways of inserting a style sheet. They are...
External Style Sheet
Internal Style Sheet
Inline Styles
example:
Continue Reading...
- External style sheet
- Internal style sheet
- Inline style
External Style Sheet
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension.
Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section. The syntax for linking an external style sheet goes:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Internal Style Sheet
An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style type="text/css">
h1 {color:navy;}
p {margin-left:20px;text-align:justify;}
</style>
</head>
<style type="text/css">
h1 {color:navy;}
p {margin-left:20px;text-align:justify;}
</style>
</head>
Inline Styles
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property.
example:
<p style="color:navy;margin-left:20px">
This is a sample paragraph.
</p>
This is a sample paragraph.
</p>
The id and class Selectors in CSS
To set a style for a HTML element, CSS allows you to specify your own selectors called
The id Selector:
The class Selector:
Continue Reading...
- id selector and
- class Sselector
The id Selector:
The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#".
The class Selector:
The class selector is used to specify a style for a group of elements. This allows you to set a particular style for many HTML elements with the same class.The class selector uses the HTML class attribute, and is defined with a "."
Unlike the id selector, the class selector is most often used on several elements.
Comments in CSS
The CSS comments are ignored by browsers. Comments are used to explain your code, and may help you when you edit the source code at a later date.
CSS comment begins with "/*", and ends with "*/".
Example:
Continue Reading...
CSS comment begins with "/*", and ends with "*/".
Example:
- /*This is a CSS comment*/
Subscribe to:
Posts
(
Atom
)