- This topic is empty.
-
AuthorPosts
-
May 6, 2016 at 7:34 pm #241328danugi.4uParticipant
There is a way to style the HTML tag itself.
They have this at
Remove the 3 lines in the html element
Put any color inside the single quotes below and run it…
document.html.style.background = ”;…and it works.
Now, when I use this code in my own html page, it doesn’t work. But it works on fiddle
(How did I get this to work in my own page?)
Another way is to attach a CSS to the element to a JavaScript and use:
function swapStyleSheet(sheet) onclick=".getElementById('pagestyle').setAttribute('href',sheet)">
The latter works; but I would have to add a different CSS for each color.
The thing is about styling the HTML tag, is it creates a border; I saw this on another site; and the page looks so freaking cool!
What else can be done to do this? I’d like to save space by not attaching a separate page for every element. I’m looking at something to do with onclick.
I have used inline JS for my other options (
page color used:onclick="document.body.style.backgroundColor='*'"
, font color used
onclick="document.body.style.color='*'"
, and font size used:
onclick="document.body.style.fontSize='*'"
) and each has worked.
May 7, 2016 at 6:22 am #241336BeverleyhParticipantHmmm this all seems rather deja vu-y.
Are you @LIP_lostinprogramming per chance?
It’s just that your conversation style (wandering off the OP’s original topic like this https://css-tricks.com/forums/topic/website-in-an-hour-challange/#post-241335), timing (when the other account stops posting and a new account springs up), topic choices (character sets, colour backgrounds, style switches, building an information website) and the fact that you’re referring to a JS function name “swapStyleSheet” that we’ve already seen used in the http://honestlee.info website, all points to you being the same person.
It’s probably better to use one account in future. Disagreements with moderators happen but hiding behind an alias afterwards seems less honest than working through it.
May 7, 2016 at 6:38 am #241337danugi.4uParticipantThat’s where I got my idea from
May 7, 2016 at 9:14 am #241347Paulie_DMemberThere is a way to style the HTML tag itself.
Of course…it’s called CSS.
It’s an element like any other.
Look
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.