On 2015-01-17 18:30, Andrei Alexandrescu wrote:
Thanks! See http://goo.gl/aHeZmQ where I've added the page title as the
ID. Sadly that doesn't work for titles that contain whitespace (quite a
few), see
that.
body id=foo
table
...
/table
/body
body#foo table {
background-color: red;
}
Or alternatively:
body
table id=foo
...
/table
/body
table#foo {
background-color: red;
}
If you have several element that needs this kind of styling you only
need to add one id, to the body tag
Hello,
I was looking at
http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png, which
includes an interesting comment: ID applied to body to allow for unique
page styling without any additional markup.
That sounds pretty interesting, so I plan to add id=$(TITLE) to the
body tag of
page, replace
slashes with dash or underscore. Something like this:
For the page http://dlang.org/spec.html
html
body id=spec
...
/body
/html
Then in the CSS you can add special styling for a given page, like this:
// custom styling for the spec page
body#spec {
background-color: black
On Saturday, 17 January 2015 at 08:22:19 UTC, Andrei Alexandrescu
wrote:
Hello,
I was looking at
http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png,
which includes an interesting comment: ID applied to body to
allow for unique page styling without any additional markup.
That
On 1/17/15 2:16 AM, Sebastiaan Koppe wrote:
On Saturday, 17 January 2015 at 08:22:19 UTC, Andrei Alexandrescu wrote:
Hello,
I was looking at
http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png, which
includes an interesting comment: ID applied to body to allow for
unique page styling
is probably to use the URL of the current page, replace
slashes with dash or underscore. Something like this:
For the page http://dlang.org/spec.html
html
body id=spec
...
/body
/html
Then in the CSS you can add special styling for a given page, like this:
// custom styling for the spec