By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,445 Members | 1,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,445 IT Pros & Developers. It's quick & easy.

how to override a CSS defination in HTML

P: n/a
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
Share this Question
Share on Google+
20 Replies


P: n/a
in post: <news:c9********************************@4ax.com >
Akseli Mki <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

P: n/a
"Akseli Mki" ...
.....
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

P: n/a
"Andrew Thompson" ...
"Akseli Mki" ...


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

P: n/a
Els


Akseli Mki 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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #5

P: n/a
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

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #7

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #8

P: n/a
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

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #10

P: n/a
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

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #12

P: n/a
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

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #14

P: n/a
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

P: n/a
brucie wrote:
stick it in your <head>

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

P: n/a
Els


Akseli Mki 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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #17

P: n/a
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

P: n/a
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 pra-quedas; funciona melhor aberta.

Jul 20 '05 #19

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.