CSS example
CSS Background
Set the background color of the page
Set the background color of different elements
Set an image as the background of the page
How to repeat a background image horizontally
How to position a background image
A fixed background image (this image does not scroll with the rest of the page)
Explanation of background properties
CSS Text
Set the text color of different elements
Remove the underline from links
Specify the space between characters
Specify the space between lines
Set the text direction of an element
Increase the space between words
Disable text wrapping within an element
Vertical alignment of inline text and images
Explanation of Text Properties
CSS Fonts
Set the font size using percentages and em
All font properties in a single declaration
Explanation of Font Properties
CSS Links
Add different colors to visited/unvisited links
Specify the background color of links
Add other styles to hyperlinks
Explanation of Link Properties
CSS Lists
All different list item markers in a list
Set an image as the list item marker
Set a list item marker image using a cross-browser solution
All list properties in a single declaration
CSS: Remove the default style of list item li
Explanation of List Properties
CSS Tables
Specify Th and TD elements and a black border for a table
Specify the width and height of a table
Set the horizontal alignment of content (text alignment)
Set the vertical alignment of content (vertical alignment)
Specify the padding of TH and TD elements
Specify the color of table borders
Set the position of the table caption
Explanation of Table Properties
CSS Box Model
Specify a total element width of 250 pixels
Specify a total element width of 250 pixels using a cross-browser solution
CSS Border
Set the width of all four borders
Set the width of the top border
Set the width of the bottom border
Setting the Width of the Left Border
Set the width of the right border
Set the style of all four borders
Set the style of the top border
Setting the Style of the Bottom Border
Set the style of the left border
Set the style of the right border
Setting the Colors of All Four Borders
Set the color of the top border
Set the color of the bottom border
Set the color of the left border
Setting the Color of the Right Border
All border properties in a single declaration
Set a different border on each side
All top border properties in a single declaration
All bottom border properties in a single declaration
All left border properties in a single declaration
All right border properties in a single declaration
Explanation of Border Properties
CSS Outline
Draw a line around an element (outline)
Explanation of outline properties
CSS Margins
Specify the margins of an element
Set the top margin of text using a value in centimeters
Set the bottom margin of text using a percentage value
Set the left margin of text using a value in centimeters
Explanation of the Margin property
CSS Padding
Set the left padding of an element
Set the right padding of an element
Sets the top padding of an element.
Set the bottom padding of an element
All padding properties in a single declaration
Explanation of the padding property
CSS Grouping and Nesting
Explanation of grouping and nesting
CSS Dimensions
Set the height of an image using a pixel value
Set the height of an image using a percentage
Setting the Width of an Element Using Pixels
Set the width of an element using a percentage
Sets the maximum height of an element.
Set the maximum width of an element using a pixel value
Setting the Maximum Width of an Element Using a Percentage
Setting the Minimum Height of an Element
Set the minimum width of an element using a pixel value
Set the minimum width of an element using a percentage
Explanation of dimension properties
CSS Display
How to hide an element (visibility:hidden)
How to not display an element (display:none)
How to display an element as an inline element
How to display an element as a block element
How to use the collapse property for tables
Explanation of the Display property
CSS Positioning
The position of an element relative to the browser window
Relative positioning of an element
Absolute positioning of an element
How to use scrollbars to display overflowing content within an element
How to set the browser to handle overflow automatically
Set the top of an image using a pixel value
Set the bottom of an image using a pixel value
Set the left of an image using a pixel value
Set the right of an image using a pixel value
Explanation of positioning properties
CSS Float
Simple use of the float property
Add a border and margin to an image and float it to the left of a paragraph
Float headings and images to the right
Float the first letter of a paragraph to the left
Create an image gallery using the float property
Enabling float - the clear property
Create a webpage without tables
Explanation of the Float property
CSS Aligning Elements
Set left/right position alignment using a cross-browser solution
Left/right alignment with float
Set left/right alignment with float using a cross-browser solution
Explanation of alignment properties
CSS Generated Content
Insert the URL in parentheses after each link using the content property
Numbering of chapters and sections such as "Section 1", "1.1", "1.2", etc.
The quotes property specifies the quotation marks
CSS Pseudo-classes
Add different colors to hyperlinks
Add other styles to hyperlinks
:first-child - matches the first p element
:first-child - matches the first i element within a p element
:first-child - matches all i elements within the first p element
CSS Pseudo-elements
Set the first letter of text as a special letter
Set the first line of text as special
Set the first letter of the first line of text as special
Using :before to insert some content before an element
Using :after to insert some content after an element
Explanation of pseudo-elements
CSS Navigation Bar
Full styling of a vertical navigation bar
Full styling of a horizontal navigation bar
Explanation of the navigation bar
CSS Image Gallery
Explanation of the image gallery
CSS Image Opacity
Create a transparent image - mouse hover effect
Create a transparent box with a background image and text
CSS Image Sprites
Image sprites - navigation list
Hover effects with image sprites
CSS Attribute Selectors
Select elements with a title attribute
Select elements with title="a specific value"
Select elements with a specific title value (using ~ to separate attribute and value)
Select elements with a specific title value (using | to separate attribute and value)
Explanation of attribute selectors
CSS Application Examples
- CSS Loading Progress Bar
- CSS Pagination Styles
- CSS Progress Bar
- CSS Tooltip Examples
- CSS Text-over-image Hover Effect
- CSS Text-over-image Hover Effect - Top to Bottom
- CSS Text-over-image Hover Effect - Bottom to Top
- CSS Text-over-image Hover Effect - Right to Left
- CSS Text-over-image Hover Effect - Left to Right
- CSS Text-over-image Hover Effect - Fade In Transparency
- CSS Vertical Button Group
- CSS Button Group
- CSS Loading Animation Effect
- CSS Loading Animation Effect 2
- CSS Loading Animation Effect 3
- CSS Loading Animation Effect 4
- CSS Dynamic Search Box
- CSS User Info Card
- CSS Card Styles
- CSS Previous/Next Page Styles
- CSS Various Notification Boxes
- CSS Three Pricing Table Styles
- CSS Toggle Switch Styles
- CSS Center a DIV Horizontally
- CSS Arrows in Four Directions
- CSS Feedback Form
- CSS Font Awesome Icon Menu Bar
- CSS Top Navigation Style Example
- CSS Sticky Note Style Effect
- CSS Horizontal Scrolling Menu
- CSS Vertical Menu
- CSS Vertical Scrolling Menu
- CSS Fixed Menu Bar
- CSS Responsive Login Form
- CSS Fixed Bottom Menu Bar
- CSS Dropdown Menu
- CSS Dropdown Content Alignment
- CSS Navbar Dropdown Menu
- CSS Navigation Bar with Search Box
- CSS Navigation Bar with Search - With Submit Button
- CSS Navigation Bar with Search - With Search Icon
- CSS Fixed Left Navigation Bar
- CSS Fixed Left Navigation Bar - Auto Height
- HTML/CSS/JS Contact Us Form Template (with Baidu Map)
- CSS Designing a Webpage
More examples:https://www.jyshare.com/examples/