473,794 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access style by name of external file?

Hi

I build a small content management system. I use different external
stylesheets for the admin section and the frontend, called admin.css and
frontend.css.

Now I would like to preview some frontend stuff in the admin section. Is
there a syntax for accessing a style from a different style sheet? For
example:

admin.css says:
h1 {
color:red;
}
p {
font-family:sans-serif;
}

frontend.css says:
h1 {
color:blue;
}
p {
font-family:serif;
}

in a file admin.html I would like to do something like:

<head>
<link rel="stylesheet " href="admin.css " type="text/css">
<link rel="alternate stylesheet" href="frontend. css" type="text/css">
</head>
<body>
<h1>Red headline</h1>
<p>Some sans serif text here</p>

<div stylesheet="use alternate stylesheet, is that possible?">
<h1>Blue headline</h1>
<p>Some serif text here</p>
</div>

</body>

I am grateful for a hint on that.

--
Markus
Jul 20 '05 #1
2 2254
Markus Ernst wrote:
Hi

I build a small content management system. I use different external
stylesheets for the admin section and the frontend, called admin.css and
frontend.css.

Now I would like to preview some frontend stuff in the admin section. Is
there a syntax for accessing a style from a different style sheet?
Not that I know of, however I'm new to CSS.
For
example:

admin.css says:
h1 {
color:red;
}
p {
font-family:sans-serif;
}

frontend.css says:
h1 {
color:blue;
}
p {
font-family:serif;
}

in a file admin.html I would like to do something like:

<head>
<link rel="stylesheet " href="admin.css " type="text/css">
<link rel="alternate stylesheet" href="frontend. css" type="text/css">
</head>
<body>
<h1>Red headline</h1>
<p>Some sans serif text here</p>

<div stylesheet="use alternate stylesheet, is that possible?">
<h1>Blue headline</h1>
<p>Some serif text here</p>
</div>

</body>

I am grateful for a hint on that.


If you can't find a clean CSS solution, & this is just for internal
previewing, how about duplicating your stlyesheets & then indenting each
line in each such duplicate with something like
..sheet<name>
for some suitable <name>

You can then apply any of those styles by including within an object to
whom you give class sheet<name> & linking to the indented sheets.

If you need to make many changes to the sheets & preview each time, you
could automate generation of the indented sheets with a little bit of
perl or other suitable language.

Maybe you'll get a simpler solution.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 20 '05 #2
"Michael Rozdoba" <mr**@nowhere.i nvalid> schrieb im Newsbeitrag
news:3f******** *************@l ovejoy.zen.co.u k...
Markus Ernst wrote:
Hi

I build a small content management system. I use different external
stylesheets for the admin section and the frontend, called admin.css and
frontend.css.

Now I would like to preview some frontend stuff in the admin section. Is
there a syntax for accessing a style from a different style sheet?


Not that I know of, however I'm new to CSS.
For
example:

admin.css says:
h1 {
color:red;
}
p {
font-family:sans-serif;
}

frontend.css says:
h1 {
color:blue;
}
p {
font-family:serif;
}

in a file admin.html I would like to do something like:

<head>
<link rel="stylesheet " href="admin.css " type="text/css">
<link rel="alternate stylesheet" href="frontend. css" type="text/css">
</head>
<body>
<h1>Red headline</h1>
<p>Some sans serif text here</p>

<div stylesheet="use alternate stylesheet, is that possible?">
<h1>Blue headline</h1>
<p>Some serif text here</p>
</div>

</body>

I am grateful for a hint on that.


If you can't find a clean CSS solution, & this is just for internal
previewing, how about duplicating your stlyesheets & then indenting each
line in each such duplicate with something like
.sheet<name>
for some suitable <name>

You can then apply any of those styles by including within an object to
whom you give class sheet<name> & linking to the indented sheets.

If you need to make many changes to the sheets & preview each time, you
could automate generation of the indented sheets with a little bit of
perl or other suitable language.

Maybe you'll get a simpler solution.

--
Michael
m r o z a t u k g a t e w a y d o t n e t


Thank you for your idea Michael. What I actually did now was a variant of
your solution: I made a separate stylesheet file for the content section and
put all the contents into a div with the id "content". And the styles are
defined as

#content h1 { ... }
#content p { ... }

and so on. So I can import that same stylesheet file into the admin preview
file without affecting the admin-specific definitions of h1 and p and so on.

--
Markus
Jul 20 '05 #3

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

Similar topics

2
2742
by: Ravi | last post by:
My XML looks like: <abc> <def type="apple"> 1 </def> <def type="peach"> 2 </def> <def type="orange"> 3 </def> <def type="banana"> 4 </def> <def type="plum"> 5 </def> </abc>
11
15751
by: George Hester | last post by:
I have a css file this is a portion of it: /* trackaccept.css */ div.track { width:400px; height: 100px; } I have this in my ASP page:
6
4756
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
3
4916
by: Xerxes | last post by:
Hi, I would like to import the tables from MySQL database into Access database and I am not sure how to go about it. I tired to "Import External Data" from Access, selected "ODBC database" from file type dropdown, selected "New data source" and picked SQL Server from the list. I specified the server name (mydomain.com) along with user id and password. But when I clicked on "Next", I got: "connection failed: SQL Server Error:10060,...
0
3733
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank text boxes how do I stop this and how would I code it to redirect to a thank you page. All with out the help of a web server this has to br ran from the desktop and with in IE with a local directory. Pleas help I am stuck. here is the code! ...
4
2783
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields (fromStop) and its associated driving directions back to a relational database. I have asked my software vendor for solutions but thus far they have not come up with anything. I am totally unfamiliar with XML so I am struggling with how to do this. I have...
1
2801
by: Webstorm | last post by:
Hi, I hope someone can help me sort this out a bit, Im completely lost. Here is the page I am working on: http://www.knzbusinessbrokers.com/default.asp I have 3 search critera that I need to use when querying the database. Right now it is only looking for a match on one of those dropdowns and not all 3. can anyone help? Here is the code: <form BOTID="0" METHOD="POST" action="businessforsale_interface/Results/test3.asp">
16
5191
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub Storage_Click() On Error GoTo Err_Storage_Click
4
5635
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got around this problem I discovered that they're using Animations. I don't want to bloat my control with the Ajaxtoolkit's Animation stuff though. I guess I should tell you what the problem is. I have a TabStrip custom control. It's a Table that has...
0
10433
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
10212
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...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
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...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
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
5436
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
4112
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
2919
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.