Posted On May 7, 2019

CSS: Basic Targeting of Tag, Class, and Type

kimconnect 0 comments
blog.KimConnect.com >> Codes >> CSS: Basic Targeting of Tag, Class, and Type
Cascading Style Sheets (CSS)

CSS is often included between the <head><style>CSS-HERE</style></head> sections so that it would load before the <body> section. The purpose of CSS is to control the display of HTML. Below is an example on how CSS targets HTML markups by Tag, Class, and Type names:

Fonts

Check out Google Fonts at this link: https://fonts.google.com. Once a desired font has been identified, set a link to it in this format: {[FONTNAME]:[bold|italic]|[FONT2NAME]:[b|i]}

<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Tangerine">
Style Section

Each Document Object Model (DOM) element would have a tag name, class name, type name, etc. In the below example, these CSS lines would target each of the named elements

<head>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Tangerine">
<style>
// Targeting Classes
.red-text {
color: red;
}

// Targeting Tags
title1 {
font-size: 48px;
font-family: 'Tangerine',serif;
text-shadow: 4px 4px 4px #aaa;
}

// Targeting Types
[type='radio']{
margin: 10px 0px 15px 0px
}
</style>
</head>
<body>

<title1>KimConnect.com</title1>

<div class="red-text">
<p>Things:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
</div>

<form action="/submit1" id="submit1">
<label><input type="radio" name="radio1" checked>Radio1</label>
<label><input type="radio" name="radio2">Radio2</label><br>
<input type="text" placeholder="field1" required>
<button type="submit">Submit</button>
</form>

<body>

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Add and Remove a Registry Key

How to Add a Registry Key # Add New Registry Key $regHive='REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM' $keyname='OleDbTimeout' $value=600 Set-ItemProperty…

PowerShell: Obtain Domain Admin Credential and Save It as an XML for Subsequent Execution

Working Version: # Initialize with defaults$credFileExists=$False# This function is a workaround to the issue of…

PowerShell: Set Virtual Machine Default Paths on Hyper-V Host of a Cluster

$newVirtualMachinePath='D:\VirtualMachines' $newVirtualHardDiskPath='D:\VirtualMachines' function getHyperVHostsInForest{ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709 =…
Other project: DragonCoin.com