The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Changing CSS to inline style
Conor
post Apr 22 2015, 02:52 AM
Post #1





Group: Members
Posts: 3
Joined: 22-April 15
Member No.: 22,514



Hi all,

Have very limited html/css experience so will do my best to explain.

Currently working with a wysiwyg editor where I don’t have access to edit the CSS. However, I found some great code online for a clickable html button but it’s mainly done through CSS. I’m wondering is there a way of changing this code so that it’s done in the below format:

<div style=”***CSS***”><div>

Wysiwyg editor will allow me to enter in html snippets but nothing more.

Link to the “button” is: Button

Any help much appreciated!!

Conor
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 22 2015, 07:28 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Nope. Parts of it can't be done inline. Why don't you change editor instead? It sounds extremely limited. Or just use a text editor for editing external files.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Conor
post Apr 22 2015, 07:44 AM
Post #3





Group: Members
Posts: 3
Joined: 22-April 15
Member No.: 22,514



Thanks for reply - unfortunately stuck with the editor for this particular project. Is the limitation related to the "press" part of the CSS? That's the real functionality I'm after. Or if there's any image-based workaround I could do I'd be happy with that as well!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 22 2015, 12:29 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You can't use psudo elements and pseudo classes (like :hover) inline. There's also some advanced CSS3 stuff that I don't think can be made inline.

I don't see what stops you from opening Notepad (or whatever) and use it. It feels like you are taking a very long way around a small problem.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 22 2015, 03:54 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,650
Joined: 10-August 06
Member No.: 7



QUOTE(Conor @ Apr 22 2015, 02:44 PM) *

Is the limitation related to the "press" part of the CSS? That's the real functionality I'm after.

Yes the pressing effect is done with the :active pseudo-class, which can't be used in inline styles. Ditto for :hover.

QUOTE
Or if there's any image-based workaround I could do I'd be happy with that as well!

You'd still need a way to detect the hovering and clicking. Perhaps a traditional javascript image rollover could be used (with the onmouseover, onmouseout and onclick attributes instead of inline styles)?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 22 2015, 04:07 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,650
Joined: 10-August 06
Member No.: 7



Just a couple of nitpicks:

QUOTE(Conor @ Apr 22 2015, 09:52 AM) *

<div style=”***CSS***”><div>

The above slanted quote characters can't be used for HTML, use ordinary " quotes instead.

QUOTE
Link to the “button” is: Button

I can't even copy the sample code on that site to my text editor. What's the point of using such a service? sad.gif

Anyway, the CSS example uses ampersand selectors like

CODE
&:hover

which apparently is part of the Sass stylesheet language and not real CSS (and won't work by directly in a browser AFAIK):
http://sass-lang.com/guide
http://sass-lang.com/documentation/file.SA...parent-selector




User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 22 2015, 07:31 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I can copy.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Apr 23 2015, 06:55 AM
Post #8


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Yep, just click the Share button and you can download a zip file of the sample on the page.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 23 2015, 10:35 AM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I copied straight off screen.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 23 2015, 02:31 PM
Post #10


.
********

Group: WDG Moderators
Posts: 9,650
Joined: 10-August 06
Member No.: 7



Now it worked for me too. Maybe it was a glitch yesterday.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 05:43 AM