creating own css classes? possible?

Feb 22, 2014 14:12

i searched for a faq or help page mentioning it, goggled like mad, didn't find it ( Read more... )

css:base themes, entries:misc

Leave a comment

Comments 15

mangacrack February 23 2014, 13:38:51 UTC
Personally I think custom css on lj is a nightmare.
I recommend installing Firebug. Press Ctrl. + Shift + C and you get a sidebar that shows you the EXACT coding, all div names and the css.

You can test your css by editing in Firebug. All you have to do is, copy it into the custom css box.

Reply

portisheart February 23 2014, 14:02:14 UTC
this mozilla inspector thingy does the same more or less, dunno how it's called. but basically, this css works fine - just not here.

i just need to know 1 single basic info: if custom classes are possible/work when they're added in the entry + customization panel.

else, i won't waste time any further and i'll just style every div in the tag. bothersome, messy to look at, might explode my entry space, but works perfectly.

i'm not even touching layers, nor do i want to learn it atm, nor any other prog, tutorial etc.
cuz i need just it for 1 single entry, 1 red and 1 green border/bgd combination.

all i need in short, is a yes or no answer, maybe a how.

Reply

mangacrack February 23 2014, 14:06:24 UTC
Sorry, no idea. I noticed that it differs from theme to theme?
It should be possible, but can't you use the code of the entry itself? Might same you some time and confusion?

Reply

portisheart February 23 2014, 14:17:11 UTC
sure, as i said already, i can style my div in the text entry/tag itself.

which means, EVERY SINGLE OF MAYBE 20-30 faq div's would look like this:



instead of: (if the class thing worked as it does in notepad etc)



i could even cut the width part and add it to the css, and have only this for each Q/A of my faq:



and write ONLY 1 TIME the whole css block in my panel.

see what's time robbing and confusing?...

Reply


nomoreprinces February 23 2014, 19:31:54 UTC
AFAIR you'd need to put any new classes and ids into the theme layer itself which requires a paid account. I think LJ strips out any that's in the css file/box itself. Not 100% sure on this though as things may have changed since I last went mucking about in the theme layer nonsense.

Reply

portisheart February 23 2014, 21:08:12 UTC
THIS is exactly what i feared, thx a lot for your opinion, which confirms it! especially since i can't see it in my inspector.
i don't know enough about how a page constructs itself - aka how it manages to read the css in the head and then, somewhen between this and printing the page ready on the screen, nullifies this block of css.. but it seems it's what happens.

EDIT: [btw i have a paid account --> but...]
if it was for a constant/recurrent (rather important) item in my layout, i would have considered daring a plunge into layer nonsense ^^ - but for one single item (even if there eventually are 30 copies of it) in one single entry - NO thanks. *really really frustrated*
i wonder why this isn't mentioned anywhere (or very well hidden) - like, "guys, don't put new own classes into the css box, it won't work", simple. don't tell me i'm the 1st to think of that use ~ >_< ~
thank you! ^^

Reply


fiddlingfrog February 25 2014, 18:39:46 UTC
You can put your own classes into the custom CSS section. I've done it before, and looking at an old entry the custom classes I included work fine. You can see for yourself in this entry of mine - the red border around the code examples is done with a custom CSS class name.

Without seeing the entire custom CSS you're including, my guess as to why you're having trouble is that you're using the .classname shorthand. A classname preceded by a period only will apply those rules to the last element specified. So if your code looks like this:

a {
color:#3344ff;
}

.faqGreen {
border: 1px solid green;
background-color: aqua;
color: #221203;
border-radius: 20px;
}
then your "faqGreen" rules will only apply to anchor tags with the class "faqGreen".

To make sure your rules are applied to divs, change your CSS to:

div.faqGreen {
border: 1px solid green;
background-color: aqua;
color: #221203;
border-radius: 20px;
}

Reply

portisheart February 26 2014, 03:54:49 UTC
thanks for your answer ( ... )

Reply

fiddlingfrog February 26 2014, 04:24:40 UTC
* Please post the entire custom CSS you're attempting to use.
* What base layout are you using?
* Can you provide a link to an entry where you're trying to use your custom classes?

Reply

portisheart February 27 2014, 11:56:22 UTC
well, finally i tried on my own lj, not the community's:
1) i used "blah" as a class (there was like 0,1% chance faqGreen would have been reserved or something) -> nope.
2) i copied YOUR howto in entry + css (first, it worded with you, second the block wasn't shorthand but separed in color, px, style) - nope.
just to make sure that it wasn't because of the word "faq", or a community page.

my own journal is portisheart but where i wanted this was in my new community andromedia3dthe style BOTH use as a base for the layout is Expressive - River at Night ( ... )

Reply


Leave a comment