Tutorial by Examples: css

CSS transforms are based on the size of the elements so if you don't know how tall or wide your element is, you can position it absolutely 50% from the top and left of a relative container and translate it by 50% left and upwards to center it vertically and horizontally. Keep in mind that with this...
String html = "<!DOCTYPE html>" + "<html>" + "<head>" + "<title>Hello world!</title>" + "</head>" + "<body>" + ...
<link rel="stylesheet" href="path/to.css" type="text/css"> The standard practice is to place CSS <link> tags inside the <head> tag at the top of your HTML. This way the CSS will be loaded first and will apply to your page as it is loading, rather th...
You can embed another template body into your template via {{template "mysharedtemplate" .}} to reuse shared components. Here is an example that creates a header template that can be reused at the top of all other template bodies. It also uses CSS to stylize the output so that it is easier...
You can add external SVG files using the background-image property, just as you would do with any other image. HTML: <div class="attention"></div> CSS: .attention { background-image: url(attention.svg); background-size: 100% 100%; width: 50px; height: ...
<link rel="alternate stylesheet" href="path/to/style.css" title="yourTitle"> Some browsers allow alternate style sheets to apply if they are offered. By default they will not be applied, but usually they can be changed through the browser settings: Firefox l...
The @import CSS at-rule is used to import style rules from other style sheets. These rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. @import. How to use @import You can use @import rule ...
Browsers have a default set of CSS styles they use for rendering elements. Some of these styles can even be customised using the browser's settings to change default font face and size definitions, for example. The styles contain the definition of which elements are supposed to be block-level or inl...
function themeSlug_enqueue_scripts() { wp_enqueue_style( 'themeSlug-reset', get_template_directory_uri() .'/css/reset.css', '1.0.0' ); wp_enqueue_style( 'themeSlug-style', get_template_directory_uri() .'/style.css', 'themeSlug-reset', '1.0.0'); } add_action('wp_enqueue_scripts', 'themeSl...
In this case style.css is located in root of the theme's folder function themeSlug_enqueue_scripts() { wp_enqueue_style( 'themeSlug-style', get_template_directory_uri() .'/style.css', '1.0.0'); } add_action('wp_enqueue_scripts', 'themeSlug_enqueue_scripts');
In this example we want to include font awesome icon font function themeSlug_enqueue_scripts() { wp_enqueue_style( 'font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css'); } add_action('wp_enqueue_scripts', 'themeSlug_enqueue_scripts');
BeautifulSoup has a limited support for CSS selectors, but covers most commonly used ones. Use select() method to find multiple elements and select_one() to find a single element. Basic example: from bs4 import BeautifulSoup data = """ <ul> <li class="item&quo...
The Protractor API allows CSS element locators to use the jQuery-like shortcut notation $(). Normal CSS Element Locator: element(by.css('h1.documentation-text[ng-bind="title"]')); element(by.css('[ng-click="submit"])); Shortcut $() CSS Element Locator: $('h1.documentatio...
CSS can be applied in multiple places: inline (Node.setStyle) in a stylesheet to a Scene as user agent stylesheet (not demonstrated here) as "normal" stylesheet for the Scene to a Node This allows to change styleable properties of Nodes. The following example demonst...
Suppose you have a simple Customer model: class Customer(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) is_premium = models.BooleanField(default=False) You register it in the Django admin and add search field by first_name...
BeautifulSoup has a limited support for CSS selectors, but covers most commonly used ones. Use select() method to find multiple elements and select_one() to find a single element. Basic example: from bs4 import BeautifulSoup data = """ <ul> <li class="item&quo...
Required modules npm install --save-dev webpack extract-text-webpack-plugin file-loader css-loader style-loader Folder structure . └── assets    ├── css     ├── images    └── js webpack.config.js const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webp...
Just as in Sass, SCSS variables are used to store a value which will be used multiple times throughout a SCSS document. Variables are mostly used to store frequently-used property values (such as fonts and colors), but can be used for any value of any property. SCSS uses the $ symbol to declare a ...
;; package.el is available since emacs 24 (require 'package) ;; Add melpa package source when using package list (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) ;; Load emacs packages and activate them ;; This must come before configurations o...
CSS body { counter-reset: item-counter; /* create the counter */ } .item { counter-increment: item-counter; /* increment the counter every time an element with class "item" is encountered */ } .item-header:before { content: counter(item-counter) ". "; /* print the v...

Page 1 of 4