milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

Few tips

Details
Written by: Stanko Milosev
Category: CSS
Published: 17 September 2014
Last Updated: 17 September 2014
Hits: 5084

# - id selector, example:

HTML:

<!DOCTYPE html>
<html>

	<head>
		<link rel="stylesheet" type="text/css" href="/index.css">
	</head>
	
	<body>
	<h2 id="featured">featured</h2>
	test
	</body>
	
</html>

CSS (index.css):

h2#featured {
	color: red;
}

Notice line <h2 id="featured">featured</h2>

element selector, example:

HTML:

<!DOCTYPE html>
<html>

	<head>
		<link rel="stylesheet" type="text/css" href="/index.css">
	</head>
	
	<body>
	<h2>featured</h2>
	test
	</body>
	
</html>

CSS:

h2 {
	color: red;
}

Notice now that I deleted ID from line <h2>featured</h2> and css is without hash sign.

. -class selector, example:

HTML:

<!DOCTYPE html>
<html>

	<head>
		<link rel="stylesheet" type="text/css" href="/index.css">
	</head>
	
	<body>
	<h2 class="myClass">featured</h2>
	test
	</body>
	
</html>

CSS:

.myClass {
	color: red;
}

Notice now how I wrote line <h2 class="myClass">featured</h2>

Rest of CSS selectors you can find here.

Order of styles

Details
Written by: Stanko Milosev
Category: CSS
Published: 10 September 2014
Last Updated: 10 September 2014
Hits: 4904

If we write something like:

<span style="font-style: normal; font-style: italic;">Css test</span>

Then font will be italic, but if we write something like:

<span style="font-style: italic; font-style: normal;">Css test</span>

Then font will be "normal".

Image in front of another

Details
Written by: Stanko Milosev
Category: CSS
Published: 19 August 2013
Last Updated: 19 August 2013
Hits: 4601

Use something like:

z-index: 9999;

Display div (or span) content on right side

Details
Written by: Stanko Milosev
Category: CSS
Published: 20 January 2013
Last Updated: 30 November -0001
Hits: 4799

To display div (or span) content on right side, use something like:

 
  <div style="float: right">
	YO! This is a test!
  </div>
  1. Override
  2. How to prevent DIV tag starting a new line
  3. Toggle
  4. Checkbox

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 158 of 168

  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162