Tutorial by Examples: css

CSS ul { list-style: none; counter-reset: list-item-number; /* self nesting counter as name is same for all levels */ } li { counter-increment: list-item-number; } li:before { content: counters(list-item-number, ".") " "; /* usage of counters() function means val...
Setting only one style: $('#target-element').css('color', '#000000'); Setting multiple styles at the same time: $('#target-element').css({ 'color': '#000000', 'font-size': '12pt', 'float': 'left', });
To get an element's CSS property you can use the .css(propertyName) method: var color = $('#element').css('color'); var fontSize = $('#element').css('font-size');
CSS styles for the credits label. Defaults to: credits: { style: { cursor: 'pointer', color: '#909090', fontSize: '10px' } },
Pure JavaScript It's possible to add, remove or change CSS property values with JavaScript through an element's style property. var el = document.getElementById("element"); el.style.opacity = 0.5; el.style.fontFamily = 'sans-serif'; Note that style properties are named in lower came...

CSS

This binding will apply the supplied CSS class to the element. Static classes are applied when the given conditions are loosely-evaluated to true. Dynamic classes use the value of an observable or computed. page.html <p data-bind="css: { danger: isInDanger }">Checks external expres...
First, Install gulp and gulp-concat plugin to your project localy npm install --save-dev gulp gulp-concat and add gulp-concat task to your gulpfile.js var gulp = require('gulp'); var concat = require('gulp-concat'); gulp.task('default', function() { }); gulp.task('css', function() { ...
First, Install gulp, gulp-clean-css and gulp-rename to project directory localy npm install --save-dev gulp gulp-clean-css gulp-rename Than add following minify-css task to your gulpfile.js var gulp = require('gulp'); var cleanCSS = require('gulp-clean-css'); var rename = require('gulp-rename...
CSS and JS files should be reside under 'static' directory in the root directory of module (the rest of subdirectory tree under 'static' is an optional convention): static/src/css/your_file.css static/src/js/your_file.js Then add links to these files unsing one of the 3 ways listed in the fol...
Odoo v8.0 way is to add corresponding record in the XML file: ​Add XML file to the manifest (i.e. __openerp__.py file.): ... 'data' : [ 'your_file.xml' ], ​... Then add following record in 'your_file.xml': <openerp> <data> <template id="...
Note: you should use this way if you've installed a "website" module and you have a public website available. Add following record in 'your_file.xml': <openerp> <data> <template id="assets_frontend" name="your_module_name assets" inherit...
Add following record in 'your_file.xml': <openerp> <data> <template id="assets_common" name="your_module_name assets" inherit_id="web.assets_common"> <xpath expr="." position="inside"> <link rel...
CSS Getter The .css() getter function can be applied to every DOM element on the page like the following: // Rendered width in px as a string. ex: `150px` // Notice the `as a string` designation - if you require a true integer, // refer to `$.width()` method $("body").css("width...
If your application is going to run on different devices, it's going to need to render to different ViewPorts, based on the device size. You can deal with this in two ways: with javascript rules, or CSS media styles. If you've been using a MVC or MVVM library, such as Angular or Ember (or Blaze, for...
Consider following html code <ul> <li id=“one” class=“main”>Item 1</li> <li id=“two” class=“main”>Item 2</li> <li id=“three” class=“main”>Item 3</li> <li id=“four”>Item 4</li> </ul> Following dom tree will be constructed ba...
Remember to npm install all the files into devDependencies first. E.g. npm install --save-dev gulp gulp-concat gulp-rename gulp-uglify gulp-uglifycss Gulpfile.js var gulp = require('gulp'); var gulp_concat = require('gulp-concat'); var gulp_rename = require('gulp-rename'); var gulp_uglify = ...
<style> input:in-range { border: 1px solid blue; } </style> <input type="number" min="10" max="20" value="15"> <p>The border for this value will be blue</p> The :in-range CSS pseudo-class matches when an element...
Angular also provides some CSS classes for forms and inputs depending on their state ClassDescriptionng-touchedField has been touchedng-untouchedField has not been touchedng-pristineField has not been modifiedng-dirtyField has been modifiedng-validField is validng-invalidField is invalid You can u...
.default-settings() { padding: 4px; margin: 4px; font-size: 16px; border: 1px solid gray; } #demo { .default-settings; } The above example when compiled would only produce the following output. The .default-settings() mixin definition would not be output in the compiled CSS fi...
A. The syntax is presented above. The following selector matches all <input> elements in an HTML document that are not disabled and don't have the class .example: HTML: <form> Phone: <input type="tel" class="example"> E-mail: <input type="em...

Page 2 of 4