473,769 Members | 6,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

::before/after on Elements Styled with display: table-*

Hi,
I was wondering if ::before and ::after pseudo-elements can apply to
elements styled with the display: table-* properties. None of my tests
worked in either Firefox or Opera, yet I could not find anywhere in
either the CSS2.1, CSS3 Selectors or CSS3 Generated and Replaced Content
Module specs that defines which elements these pseudo-elements actually
apply to.

Specifically, I was wondering if something like this were possible:

table>:not(col) :not(colgroup): first-child::before {
/* Should work with thead, tfoot, tbody or tr (whichever comes first
* in the table), if not preceded by a col or colgroup element.
*/
display: table-column;
background: green;
}
--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 21 '05 #1
4 5632
Lachlan Hunt:
I was wondering if ::before and ::after pseudo-elements can apply to
elements styled with the display: table-* properties.
They should, AFAICT.
table>:not(col) :not(colgroup): first-child::before {
/* Should work with thead, tfoot, tbody or tr (whichever comes first
* in the table), if not preceded by a col or colgroup element.
*/
Note that the 'tr' case will only ever occur in XHTML and HTML 3.2, but
never in HTML4. Do not forget 'caption' (also in 3.2).
display: table-column;


Advanced stuff like 'display' or 'position' has always been problematic
with generated context. File bug-reports, if you are sure you made no
mistake in your test-case.
Jul 21 '05 #2
Christoph Päper:
Lachlan Hunt:
table>:not(col) :not(colgroup): first-child::before {
display: table-column;


File bug-reports, if you are sure you made no mistake in your test-case.


I suppose not everyone here is reading www-style, too. Those of you
should know that it in fact should *not* work, because '::before' is not
actually put before the box, but before all of its child boxes. (How
could I forget that?) I'm too lazy to look up whether ':first-child'
should apply to it then.
Jul 21 '05 #3

"Christoph Päper" wrote
Christoph Päper:
Lachlan Hunt:
table>:not(col) :not(colgroup): first-child::before {
display: table-column;


File bug-reports, if you are sure you made no mistake in your test-case.


I suppose not everyone here is reading www-style, too. Those of you
should know that it in fact should *not* work, because '::before' is not
actually put before the box, but before all of its child boxes. (How
could I forget that?) I'm too lazy to look up whether ':first-child'
should apply to it then.


W3C CSS spec:

User agents must ignore the following properties with :before and :after
pseudo-elements: 'position', 'float', list properties, and table properties.

The :before and :after pseudo-elements elements allow values of the
'display' property as follows:
- If the subject of the selector is a block-level element, allowed values
are 'none', 'inline', 'block', and 'marker'. If the value of the 'display'
has any other value, the pseudo-element will behave as if the value were
'block'.
- If the subject of the selector is an inline-level element, allowed values
are 'none' and 'inline'. If the value of the 'display' has any other value,
the pseudo-element will behave as if the value were 'inline'.
Jul 21 '05 #4
Pawel Knapik:
W3C CSS spec:


CSS 2.0 that is. CSS 2.1 relaxes many of the requirements regarding
generated content. CSS 2.0 already said:

| Note. Other values may be permitted in future levels of CSS.

<http://www.w3.org/TR/CSS2/generate.html#b efore-after-content>
<http://www.w3.org/TR/CSS21/generate.html#b efore-after-content>

(Yes, CSS 2.1 is back to WD status for at least another week.)
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1971
by: Pete | last post by:
Hello everybody -- Forgive my multi-posting my question. I posted first to ciwah, but I learned that ciwas is the better group for this CSS question. The problem has me stopped. The page: http://www.key-horse.com/fftst.html is rendered completely differently by Firefox 1.0 and IE 6.0. The code
1
4344
by: Dave R | last post by:
Hey everybody! I'm in dire need of some help. I'm trying to loop through all the elements in a form, and determine whether or not the field is visible. Kinda like this: var TForm = document.form1; for (i=0;i<TForm.length;i++) {
1
2145
by: Spartanicus | last post by:
I'm pondering what the various drawbacks are of the methods to code UI elements who's function relies on javascript and css. Currently on http://www.pan-europe.utvinternet.ie/ I use styled <a> elements to display two UI elements that via javascript select alternate stylesheets that enable or disable the left utilities panel and/or the navbar. (both are there for the convenience of desktop users, they are not essential, likely to be a...
28
1956
by: neoswf | last post by:
Hi Guys i need to call an ID before he was created cause i want to change his display status (none:block) and i dont want to load him and only after he was loaded to change his display settings. i tried an unValid techniuqe- to write on the fly inside the body, couse only there i can do so, a style tag that chage the display definitions, but i cannot place a style tag inside the body. any ideas?
25
2476
by: Dave | last post by:
Hello. In trying to get an anchor element to stylistically match an input or button element, I find that the button and input cannot be styled according to the 2.1 CSS spec. For example, I expected this ruleset: ..but { display: block; background-color: red; font-size: 14px; text-decoration: none; line-height: 16px; width: auto; height: 16px; padding: 0; margin: 0;
5
3436
by: Stan Brown | last post by:
URL: http://www.tc3.edu/instruct/sbrown/stat50/qz99_.htm CSS: http://www.tc3.edu/instruct/sbrown/print.css (for print) IE6 and Mozilla both do what I want on screen, but IE is acting odd in print. Questions 3 and 4 are styled with identical floats, padding, etc., but for some reason IE indents the "3" of question 3. The only difference I'm seeing is that one is styled with page-break- before:always and the other with margin-top:2em. ...
4
2133
by: plumba | last post by:
Let me explain.... I have a form (most of which you guys have helped me with!!). The initial problem I was having is that it was holding the data in the fields after submit, I resolved this by putting the whole form in a set of <div> tags and the form now collapses after they click submit. Perfect!! But, have set some mandatory fields using java, and I need to it validate the these fields before it collapses the form - otherwise it says...
5
20035
by: Summercool | last post by:
wow... i didn't know that, for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <span style="width: 100px; background: yellow">a</span>b <div style="width: 100px; background: yellow">a</div>b
2
6509
dlite922
by: dlite922 | last post by:
Hey guys been a while since I needed your help. I've got a reporting system (yes same old one) , one button runs the report and builds the html table into the page all nice with CSS, etc, the other button produces a CSV output. I set the header variables (content-type, etc...) so that the user gets the Open/Save/Cancel prompt instead of outputing the CSV data. The problem: Since some of these reports take a long time, When a button...
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.