Headers and css classes
started by: tadhgktadhgk
on: 1206875103|%e %b %Y, %H:%M %Z|agohover
number of posts: 6
rss icon RSS: new posts
summary:
Not working with each other
Headers and css classes
tadhgktadhgk 1206875104|%e %b %Y, %H:%M %Z|agohover

I ran across a problem with defining CSS yesterday which I have been unable to solve:

My site is using various templates. It's a writing-oriented site, which means that users can upload their scripts, poetry or other stuff (I'll publicly unveil it soon). In fiction writing there are several formatting conventions that are used, and I'm using templates to cover this. The basic structure is that selecting the right template pastes a div section into the document which invokes a specific CSS class.

Here's an example:

[[div class="fiction"]]

Put your text here

[[/div]]

This invokes a piece of css, as follows:

.fiction
{
width: 470px;
text-indent:30px;
font-family: "Times";
font-size: 12pt;
text-align:justify;
}

.fiction li
{
text-indent: 0px;
line-height: 16pt;
}

.fiction p
{
line-height: 16pt;
}

All of this works well. However, I tried to include some css for headers as well:

.fiction h1, h2, h3, h4, h5, h6
{
margin-bottom:0px;
}

This didn't really work. What happened (especially when I had several such sections in) was that wikidot seemed to be paying attention to only the last heading styles, and then applying them globally. This was particularly noticeable when I included a heading style for a screenplay-style template with a font-family set to Courier. The result was that the whole page, the sidebar and so forth turned all of its headings to Courier despite this property being clearly defined as only a class property.

Is there a reason why this is happening, or is it just a bug in the way that wikidot interprets css for headers?

unfold Headers and css classes by tadhgktadhgk, 1206875104|%e %b %Y, %H:%M %Z|agohover
Re: Headers and css classes
Phil ChettPhil Chett 1206877143|%e %b %Y, %H:%M %Z|agohover

now i have had a quick look at your css…
(it would be nice to "see" what you are trying to do, but your site/s are members only)
i am deffinatley thinking you need to set up some categories.
create a theme for each, and apply it.
then you wont have to faff around with your div styles in your template/s which will make it easier all round.


PHILCHett.gif
unfold Re: Headers and css classes by Phil ChettPhil Chett, 1206877143|%e %b %Y, %H:%M %Z|agohover
Re: Headers and css classes
tadhgktadhgk 1206879518|%e %b %Y, %H:%M %Z|agohover

The problem I have there is that I don't expect my users to be particularly adept at understanding how to create pages in categories. What I mean is that in order for, say, a poetry category to work, the user would have to create a page called poetry:title every time they wanted to upload something, and I'm pretty sure that most poets out there will mess that up, either creating a bad category ("poems") or forgetting and just uploading the title. That's a lot of admin work.

Whereas if I have a template with a drop-down menu, that's easier to explain.

The other problem is that for screenplays in particular the formatting is complicated, and a simple category won't quite cover it.

last edited on 1206879613|%e %b %Y, %H:%M %Z|agohover by tadhgk + show more
unfold Re: Headers and css classes by tadhgktadhgk, 1206879518|%e %b %Y, %H:%M %Z|agohover
Re: Headers and css classes
tadhgktadhgk 1206880481|%e %b %Y, %H:%M %Z|agohover

Oh, I created a test site that you could look at which shows the same behaviour: http://testsite2.wikidot.com/

The CSS is in the custom theme, and I've applied the div to the main page, to see the results.

unfold Re: Headers and css classes by tadhgktadhgk, 1206880481|%e %b %Y, %H:%M %Z|agohover
Re: Headers and css classes
Craig MacomberCraig Macomber 1206901591|%e %b %Y, %H:%M %Z|agohover

The problem I have there is that I don't expect my users to be particularly adept at understanding how to create pages in categories. What I mean is that in order for, say, a poetry category to work, the user would have to create a page called poetry:title every time they wanted to upload something, and I'm pretty sure that most poets out there will mess that up, either creating a bad category ("poems") or forgetting and just uploading the title. That's a lot of admin work.

You could have an add poem button what would put it in the correct category. Also, with categories, it would be easy to make a list of all the uploaded poems (You choose the sort), and on that page have a button to add one.

unfold Re: Headers and css classes by Craig MacomberCraig Macomber, 1206901591|%e %b %Y, %H:%M %Z|agohover
Re: Headers and css classes
tadhgktadhgk 1206909432|%e %b %Y, %H:%M %Z|agohover

Yeah, in my other recent bug it was explained to me. Although my first attempts at doing that have yielded some bizarre results that I might not be able to fix.

Regardless, the headers are behaving incorrectly, surely?

unfold Re: Headers and css classes by tadhgktadhgk, 1206909432|%e %b %Y, %H:%M %Z|agohover
new post
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.