0

Why is the CSS class designed so that it can not contain another CSS class?

 2 years ago
source link: https://www.codesd.com/item/why-is-the-css-class-designed-so-that-it-can-not-contain-another-css-class.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Why is the CSS class designed so that it can not contain another CSS class?

advertisements

Why one CSS class can't contain another CSS class e.g.

.parentCSS width:100% childCSS

I really have many duplicate entries in my file because of this

Somewhere on the aspx page (one control many CSS classes) and somewhere in the CSS file (one CSS class many duplicate attributes).

Any suggestion to write proper CSS if CSS nesting is unachievable would be very helpful.


Because CSS wasn't build that way, it doesn't support nesting, however there is a plugin http://lesscss.org/ that allow you to create stylesheets in a more flexible way.

LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the client-side (Chrome, Safari, Firefox) and server-side, with Node.js and Rhino.

Related Articles

Pagination of the Soundcloud API - does the 8000 shift limit mean that you can not get an entire list of more than 8000?

I'm trying to figure out how to retrieve a list of 60k+ followers through pagination. Right now, this is how I'm doing it (I'm guessing this could be syntactically better): var array = []; var page_length = 200; var num_pages = 40; var offset = 0; fo

Why does the background image work in one place but not in another?

I'm working on some custom wordpress theme and in my style.css I've got two places where I'm using background-image, here it works fine: #gallery { background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-si

Java - Actionlistener showing the error for a reason that I can not see

In the if statement, it is failing to find launchBtn. I'm probably doing something stupidly obvious. Can anyone see what's wrong? The errors are in bold (or highlighted with two **, Here is my code: package launcher; import java.awt.event.*; import j

How to mark the fields of integrated structures that you can not modify?

Suppose there is an external library libA who declares NotMyType. type NotMyType struct { NotMyField string } And you would like to embed it with one of your own types, which you use with an ORM, which uses the tags to adjust column properties. type

The Facebook logon in laravel 5.2 can not contain the session after the redirect

I am using Facebook PHP SDK to log my user. I created a guard called login for this Here is my config file of auth.php 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' =

Why was the String class designed this way?

Why was the String class designed in a way that instances of this class are pooled as well as immutable? Thanks & Regards, Vidyakar Sharma.String objects aren't usually pooled - only string constants are pooled automatically via interning. (You can c

Why is the IdentityUser class in the Microsoft.AspNet.Identity.EntityFramework namespace and not in the Core package?

Why is the IdentityUser class in the Microsoft.AspNet.Identity.EntityFramework package instead of being included in the Microsoft.AspNet.Identity.Core package? Why should it depend on EntityFramework? It seems to be a simple class. What am I missing?

Why are the final classes ready for use with CDI?

Section 5.4.1 of the CDI spec states that otherwise valid beans are unproxyable (and thus cannot be injected) if declared final. The spec gives no rationale and I can not think of a reason for this decision. I am trying to stick by design rules sayin

Why does the Thread class do not support the clone method?

/** * Throws CloneNotSupportedException as a Thread can not be meaningfully * cloned. Construct a new Thread instead. * * @throws CloneNotSupportedException * always */ @Override protected Object clone() throws CloneNotSupportedException { throw new

Why is the CSS load of the node.js application loaded in my IDE but not on a localhost?

I am making a nodejs application using LightTable, and the css seems to be loading fine when I indicate a relative path to the file in my <link href=""> tag. When I run node index.js, however, the server starts up and the page loads fine,

Iam create a poker game in Flash AS3, what are the best design templates that I can use?

Iam creating a Flash AS3 based Poker game for my company. Some like zynga poker, what are the best design patterns that I can use in my game. All suggestions are welcome, I am looking to create a good designed game which can support huge number of pl

SQL constraint so that there can not be rows with the same column A but different column values ​​B?

Need constrain that will refuse insert/update if there is already some row with same value in column A but different value in B. So: Insert TableName(A, B) Values(x, y) Insert TableName(A, B) Values(x, y) Insert TableName(A, B) Values(x, z) Will fail

an example on the issue of the order of execution of the callback nodejs that I can not understand

I wrote an example code following. //test.js var fs = require('fs'); fs.readdir(__dirname+'/app/img/', function(err, files) { console.log(files); }); someFunction(function(output){ console.log(output); }); console.log('This is the final console call'

How do I access the user interface that applescript can not access?

I'm looking for the way to access UI which applescript can not access. I know applescript can access UI element. But sometimes I meet the case I can't access UI element by applescript. Like below ... tell application "System Preferences" to acti

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK