473,410 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Tweaking the style of child elements inline

Hi,

It's interesting if it is possible to use CSS rules for styling child
elements inline? What I mean is if there is a way to apply CSS rules
like this:

<ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
way -->
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ul>

I would like to apply some styles for child elements inline just like
we can do this as usual:

<style type="text/css">
li{margin: 0;}
</style>

Thank you.
Mar 1 '08 #1
5 12272
al******@gmail.com wrote:
It's interesting if it is possible to use CSS rules for styling child
elements inline? What I mean is if there is a way to apply CSS rules
like this:

<ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
way -->
I don't think it is possible, the style attribute value is a list of CSS
properties with property name and value. You are trying to put a CSS
rule in there but that is not possible.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 1 '08 #2
On 2008-03-01, Martin Honnen <ma*******@yahoo.dewrote:
al******@gmail.com wrote:
>It's interesting if it is possible to use CSS rules for styling child
elements inline? What I mean is if there is a way to apply CSS rules
like this:

<ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
way -->

I don't think it is possible, the style attribute value is a list of CSS
properties with property name and value. You are trying to put a CSS
rule in there but that is not possible.
Indeed, although something like it was proposed at some time. I don't
know what happened but I don't think anyone's implemented it.
Mar 1 '08 #3
Scripsit al******@gmail.com:
It's interesting if it is possible to use CSS rules for styling child
elements inline?
It's off-topic in this group.
<ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
way -->
You're apparently thinking that there's something that prevents you from
using CSS normally. Making things up won't help. Please note that all
c.i.w.a.* groups are supposed to discuss authoring of WWW pages.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 1 '08 #4
On Mar 1, 8:16*pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit alain...@gmail.com:
It's interesting if it is possible to use CSS rules for styling child
elements inline?

It's off-topic in this group.
<ul style="li{ margin: 0; }"<!-- *NOT SURE if it is possible in some
way -->

You're apparently thinking that there's something that prevents you from
using CSS normally. Making things up won't help. Please note that all
c.i.w.a.* groups are supposed to discuss authoring of WWW pages.

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
The logic is that if inline styles are supported, then in some
particular cases you may find them useful. Of course, the least thing
I would like to do here is "to make things up". But you may agree with
me that again in some cases it can be quite handy to have such a
feature. CSS is evolving in such a way that newer versions allow you
to do things faster and reduce the amount of code. Thank you all for
participating in this discussion in any case. I thought I may have
missed this feature but it turns out it is not the case.
Mar 1 '08 #5
Jukka K. Korpela wrote:
Please note that all c.i.w.a.* groups are supposed to
discuss authoring of WWW pages.
Then why don't you do that? Normally you are a very good
contributor to newsgroups, but lately all we have heard
from you is criticism of the way people ask questions.

If you don't have anything to contribute, then don't post.
Mar 2 '08 #6

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

Similar topics

0
by: Anne van Kesteren | last post by:
Ok, here it goes. Originally I submitted this proposal to www-style. Since I don't get feedback there, I think I missed a few (maybe a lot) of points. Proposal:...
13
by: TheKeith | last post by:
Is it just me or does opera and ie not render the float style properly? IE does a sucky job at it, but opera makes a total mess; Mozilla/Firefox renders it correctly however. I'm just trying to be...
2
by: ivanhoe | last post by:
What I wanted was to get rid of offsetLeft and use "proper" way instead....but when I do document.getElementById('someDiv').style.left; I keep getting empty string, unless I first set it manually...
5
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are...
4
by: jarek | last post by:
Hi, this is my code: CSSStyleDeclaration.prototype.__defineSetter__('display', displaySetter); function displaySetter(value) { var parent = findParent(document, this); if (parent) {
8
by: Grzegorz ¦lusarek | last post by:
Hi all. I have to create a part of me site by javascript code (must create div that contain 2 divs and these divs must be horizontal on the page). So here is the part of js code: divMain =...
3
by: MIS Director | last post by:
Is there any tool out there that will analyze an entire website and produce a report of inline style usages by both total count and detail occurrances. This would produce a list of possible...
1
by: =?Utf-8?B?SmltSGVhdmV5?= | last post by:
If I create a <divand specify that I want the font-size to be 1.2em for instance, why do the <asp:controls not follow this rule if they are contained within the <divstatement? How/what do I need...
10
by: angelina18 | last post by:
Hi. This is my first post here and my first css site. I read alot of the previous posts and therefore I did validate my code, but I couldn't find the answers to my 2 problems which are: 1. When I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.