473,379 Members | 1,235 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,379 software developers and data experts.

how to override a CSS defination in HTML

Hi,
I have a CSS file saying:
#content { position: absolute; top: 1em; left: 8em;
padding-bottom:0.5em; }
I want it to work as:
#content { position: absolute; top: 1em; left: 10em;
padding-bottom:0.5em; }
without changing the CSS file. Is that possible, if yes, what are the magic
words?
Jul 20 '05 #1
20 6740
in post: <news:c9********************************@4ax.com >
Akseli Mäki <ak*************************@nic.fi> said:
#content { position: absolute; top: 1em; left: 8em; padding-bottom:0.5em; }
I want it to work as:
#content { position: absolute; top: 1em; left: 10em;padding-bottom:0.5em; }
without changing the CSS file.


stick it in your <head>

<style type="text/css" media="whatever">#content{left:10em;}</style>
--
brucie - i usenet nude
Jul 20 '05 #2
"Akseli Mäki" ...
.....
I have a CSS file saying: .... I want it to work as:
<something different>
without changing the CSS file. Is that possible, if yes, what are the magic words?


...errr. DWIMNWIS? Abra-Cadabra?
Telepathy/Telekinesis? ;-)

--
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology
Jul 20 '05 #3
"Andrew Thompson" ...
"Akseli Mäki" ...


Took me a few more moments to realise
the alternative that _did_ make sense, but
brucie beat me to it.

That's my excuse, and I'm sticking with it!
Jul 20 '05 #4
Els


Akseli Mäki wrote:
Hi,
I have a CSS file saying:
#content { position: absolute; top: 1em; left: 8em;
padding-bottom:0.5em; }
I want it to work as:
#content { position: absolute; top: 1em; left: 10em;
padding-bottom:0.5em; }
without changing the CSS file. Is that possible, if yes, what are the magic
words?


You can do that by adding the wanted style to your html file.
<style>
#content { position: absolute; top: 1em; left: 10em;
padding-bottom:0.5em; }
</style>
</head>
However, I've noticed, that Opera versions 7.2 and higher
will only pick up on the style in the html file after
reloading the page.
Which I think is a bug.
Does anyone know?

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #5
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
You can do that by adding the wanted style to your html file.
<style>
invalid. type is required
#content { position: absolute; top: 1em; left: 10em;
padding-bottom:0.5em; }
only the left property is changing so you only need to specify the new
value for it, not the entire thing again.
However, I've noticed, that Opera versions 7.2 and higher
will only pick up on the style in the html file after
reloading the page.


you're retrieving the file out of your cache which is the old
pre-modified file, not the new one.

--
brucie - i usenet nude
Jul 20 '05 #6
Els


brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
You can do that by adding the wanted style to your html file.
<style>
invalid. type is required


true, i forgot
#content { position: absolute; top: 1em; left: 10em;
padding-bottom:0.5em; }


only the left property is changing so you only need to specify the new
value for it, not the entire thing again.


true again :-)
However, I've noticed, that Opera versions 7.2 and higher
will only pick up on the style in the html file after
reloading the page.


you're retrieving the file out of your cache which is the old
pre-modified file, not the new one.


so, after i reload the page, i should think the file in the
cache is updated.
but if i use a link to leave the page, and come back again,
the problem occurs again. And only Opera 7.2 and 7.23 do
that on my computer. None of the other browsers I use
(NS7.1, Moz1.4, Firebird0.6.1, IE6.0)have that, not even
Opera 7.01 and 7.11.
It does have something to do with the cache however, cause
it doesn't happen with the local files. Only the uploaded
ones. Of course I have emptied my cache, but that didn't
make a difference.

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #7
Els


Els wrote:
brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
However, I've noticed, that Opera versions 7.2 and higher will only
pick up on the style in the html file after reloading the page.


you're retrieving the file out of your cache which is the old
pre-modified file, not the new one.


so, after i reload the page, i should think the file in the cache is
updated.
but if i use a link to leave the page, and come back again, the problem
occurs again. And only Opera 7.2 and 7.23 do that on my computer. None
of the other browsers I use (NS7.1, Moz1.4, Firebird0.6.1, IE6.0)have
that, not even Opera 7.01 and 7.11.
It does have something to do with the cache however, cause it doesn't
happen with the local files. Only the uploaded ones. Of course I have
emptied my cache, but that didn't make a difference.


I've uploaded the example that gave the problem.
http://www.mediatech.nl/~rachel/Rachel/live.html
Now when u see the page, there are scrollbars to access all
the thumbs.
Now click on Music in the menu (other links either don't
work or will take you to the actual site).
And then click on Live Pictures in the menu (or on Live on
the page itself)-> scrollbars have gone. Now reload the page
-> scrollbars are back.
eh.. in Opera 7.2 or 7.23 of course.
This can't purely be the cache, can it?

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #8
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
I've uploaded the example that gave the problem.
http://www.mediatech.nl/~rachel/Rachel/live.html


your css is invalid. perhaps opera is having difficulty guessing what
you want.
--
brucie - i usenet nude
Jul 20 '05 #9
Els


brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:

I've uploaded the example that gave the problem.
http://www.mediatech.nl/~rachel/Rachel/live.html

your css is invalid. perhaps opera is having difficulty guessing what
you want.


who knows.
However...
I've made all valid now (html file, css file and style part
of html file).
Still same problem.
Bug?
Maybe?

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #10
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
I've uploaded the example that gave the problem.
http://www.mediatech.nl/~rachel/Rachel/live.html
your css is invalid. perhaps opera is having difficulty guessing what
you want.
who knows.
However...
I've made all valid now (html file, css file and style part
of html file).
Still same problem.
Bug?
Maybe?


i don't know. normally i would download a page and have a play with it
but in this case its too huge, i gave up after 100k. waste of time
looking when the page needs to be redone anyway.

--
brucie - i usenet nude
Jul 20 '05 #11
Els


brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
I've uploaded the example that gave the problem.
http://www.mediatech.nl/~rachel/Rachel/live.htmlyour css is invalid. perhaps opera is having difficulty guessing what
you want.

who knows.
However...
I've made all valid now (html file, css file and style part
of html file).
Still same problem.
Bug?
Maybe?


i don't know. normally i would download a page and have a play with it
but in this case its too huge, i gave up after 100k. waste of time
looking when the page needs to be redone anyway.


100k... only if you want the pictures and backgrounds with
it, of course.
But you're right, the page is an earlier version of what i
have online now, so there is no need.
And more over: locally it doesn't have that problem, so it's
difficult to try and see what's wrong on your own hd. You'd
have to upload it after every little change, to see what
happens.

Thanks for looking at it anyway. :-)

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #12
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
i don't know. normally i would download a page and have a play with it
but in this case its too huge, i gave up after 100k. waste of time
looking when the page needs to be redone anyway.
100k... only if you want the pictures and backgrounds with
it, of course.
web optimizer tells me its a total of 214717 bytes which would take me
over 177 seconds to download.
And more over: locally it doesn't have that problem, so it's
difficult to try and see what's wrong on your own hd. You'd
have to upload it after every little change, to see what
happens.


i whipped up a quick file and couldn't repeat the problem locally or
not. scroll support in opera is still new so perhaps it still has some
issues.
--
brucie - i usenet nude
Jul 20 '05 #13
Els


brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:

i don't know. normally i would download a page and have a play with it
but in this case its too huge, i gave up after 100k. waste of time
looking when the page needs to be redone anyway.
100k... only if you want the pictures and backgrounds with
it, of course.


web optimizer tells me its a total of 214717 bytes which would take me
over 177 seconds to download.


which is way to much time and hd space ;-)

if you're interested, I've uploaded a stripped down version
of it, all the excess info and pictures and everything has
gone, it's here: http://home.tiscali.nl/~elizabeth/live.html
if you still get over 200000 bytes, you might want to make
sure you're not downloading the linked files, cause there
are many. To see the problem, you only need
http://home.tiscali.nl/~elizabeth/live.html
http://home.tiscali.nl/~elizabeth/music.html
http://home.tiscali.nl/~elizabeth/allold.css
which, together, will be 8250 bytes.
Hang on, I can take out the links too...
Kay, now it's only 4147 bytes.
Plus no links to download accidentally ;-)
i whipped up a quick file and couldn't repeat the problem locally or
not. scroll support in opera is still new so perhaps it still has some
issues.


it's not the scroll support itself.
The problem is, that the css file says overflow:hidden,
while in the html file this is overruled by overflow:scroll.
If I put overflow:scroll in the css file, all works as expected.
And even the way I did it in this example is supported by
earlier versions of Opera.
If Opera is rendering correctly, I'd say my mistake must be
somewhere in the way I wrote
<style type="text/css">
@import url(allold.css);
#content{overflow:scroll;}
</style>
in the html file.
For some reason, Opera 7.2 only 'sees' the #content rule
after reloading the page.

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #14
Els wrote:
However, I've noticed, that Opera versions 7.2 and higher
will only pick up on the style in the html file after
reloading the page.
Which I think is a bug.
Does anyone know?

My Opera seems to work at least on my pages. I've found something
intresting after reloading the page, though. I'll annoy Opera NG with it.


Jul 20 '05 #15
brucie wrote:
stick it in your <head>

Heh, thanks for the spell.
Jul 20 '05 #16
Els


Akseli Mäki wrote:

I've found something
intresting after reloading the page, though. I'll annoy Opera NG with it.


Which Opera NG? Cause I'm curious now :-)

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #17
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
if you're interested, I've uploaded a stripped down version
of it, all the excess info and pictures and everything has
gone, it's here: http://home.tiscali.nl/~elizabeth/live.html


it works fine but i did discover i was using 7.5 last night not 7.23
which does demonstrate the problem.

--
brucie - i usenet nude
Jul 20 '05 #18
Els


brucie wrote:
in post: <news:40**********************@dreader2.news.tisca li.nl>
Els <el***********@tiscali.nl.invalid> said:
if you're interested, I've uploaded a stripped down version
of it, all the excess info and pictures and everything has
gone, it's here: http://home.tiscali.nl/~elizabeth/live.html


it works fine but i did discover i was using 7.5 last night not 7.23
which does demonstrate the problem.


kay, so i'm gonna download yet another version of Opera :-)
7.23 was only weeks ago, it seems to me...

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #19
Els <el***********@tiscali.nl.invalid> wrote in news:401ec137$0$41749
$5******@dreader2.news.tiscali.nl:
kay, so i'm gonna download yet another version of Opera :-)
7.23 was only weeks ago, it seems to me...


I think it is a preview browser; you may wish to wait until the beta
testing is over

--
Kayode Okeyode
http://www.kayodeok.co.uk/weblog/
http://www.kayodeok.btinternet.co.uk.../webdesign.htm
Jul 20 '05 #20
Els wrote:
I've found something
intresting after reloading the page, though. I'll annoy Opera NG with it.

Which Opera NG? Cause I'm curious now :-)

Opera.general.
See Message-ID: <tl********************************@4ax.com>
Jul 20 '05 #21

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

Similar topics

4
by: Guo Congbin | last post by:
·¢¼þÈË: "Guo Congbin" <guocongbin@sei.buaa.edu.cn> Ö÷Ìâ: is size_t a keyword?or a macro? ÈÕÆÚ: 2004Äê6ÔÂ17ÈÕ 23:04 if size_t is a macro, where is the defination? i look it up in the stddef.h,...
8
by: scl | last post by:
two class with same name exist in different dynamic linked library: a.so class REGION() { public: .... ~REGION() {} } b.so
3
by: Woodmon | last post by:
Example of my CSS follows: <style type="text/css" media="screen"> BODY { color: white } A:link { color: 66CCFF; } A:visited { color: CC66FF; } A:active { color: CC66FF; } A:hover {...
1
by: DIA | last post by:
Can we find the defination of a SQL stored procedure using c#? 1. Using SQL-DMO in c# I was able to locate a SQL server in the network. 2. Hit the target database in the selected server. 3....
0
by: Vikramaditya Singh | last post by:
i have made a crystal repoirt using field defination methos (.ttx). Now i am passing a dataset to it at runtime but no records is beiing displayes this is the code i am using to creating dataset...
3
by: sunnylele | last post by:
Hi, all, a question on the following defination: an external function is defined as: nmriopen(char *const filename, const int np1, const float step1, const int np2, const float step2) what's...
10
by: toton | last post by:
Hi I have a class called Session, which stores a vector of Page, like vector<PageAlso each Page need's to know the Session to which it is attached. Thus I have, (the classes has many other...
25
by: venky | last post by:
Hi main() { int x; /* it declaration or defination??*/ }
1
by: Johnny E. Jensen | last post by:
Hello I have a class that inherence from the ToolStrip control called (AWToolbar), and i added my own methods to that class. Then i have a usercontroll (QuickNavigator), and I add the AWToolbar,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.