Board index PBase HTML and Style Sheets CSS declarations don't all work.

HTML and Style Sheets

CSS declarations don't all work.

Customize your galleries.
kvogelphoto
 
Posts: 11

CSS declarations don't all work.

Post Thu Jul 17, 2014 7:55 pm


I've gotten started modifying my own CSS. I generally do HTML modifying the html text so I'm doing CSS editing the same way since I'm making rather simple changes in outlook to my stylesheets. I have run into a problem. Here is the sample of code I placed into my style sheet:

H2 {
text-align: center;
background-color: #F5D0A9;
}

hr {
color: #D7740A;
size: 5px;
width: 70%;
align: center;
noshade;
}

For H2 (the title of the page) I get the text centered but the background color does not change.
For HR it is aligned properly, 70% width with no shade but I don't get the right color or pixel height. I do get all when I specifically tell it how to make an individual hr i.e. <hr color="#D7740A" size=5 width="70%" align="center" noshade>

So why are my css declarations not all working?

Karl

kvogelphoto
 
Posts: 11

Re: CSS declarations don't all work.

Post Thu Jul 17, 2014 8:16 pm


I tried this method but got the same results. In the style sheet I added:
#ss2hr {
color: #D7740A;
size: 5px;
width: 70%;
align: center;
noshade;
}

Then in the description I included:
<hr id="ss2hr">

It seems the declarations made in our stylesheet are limited in their scope.

kvogelphoto
 
Posts: 11

Re: CSS declarations don't all work.

Post Fri Jul 18, 2014 2:52 am


I realized something else. On another computer where I was not logged into my account none of css declarations that I made were showing. When I log in then just a few show (center, 70%) but the others don't.

To me this seems something is not so tidy with how Pbase is using the stylesheets. Why would being logged in display differently than not being logged in?

So here is a simple question. How can I make the Title on all galleries be centered? For me it works only when I'm logged in but you can't see it on my galleries since you can't log in to my account.

dw_thomas
 
Posts: 481

Re: CSS declarations don't all work.

Post Fri Jul 18, 2014 5:13 pm


Dunno, I just tried looking at a few of your galleries while logged in and logged out and the titles appeared centered.

I'm no CSS guru by a long shot, but a couple of those lines in the CSS code you showed didn't work for me when I installed them in a local CSS file that I use here on my system, as though maybe there are some problems with the notation.

(I once made a living writing embedded systems code for down-on-the-bare-silicon stuff, but after a dozen years of retirement, my aging brain can't keep up with the pace of new tricky software languages! :lol: )

EDIT: I suppose I should mention I'm using Firefox 30.0 on Win 7x64.

DaveT

kvogelphoto
 
Posts: 11

Re: CSS declarations don't all work.

Post Mon Jul 21, 2014 2:44 am


Thanks for looking into this. Yes it seems some of my computers can center the titles while others don't. Not sure what the difference is since I'm using the same versions of Firefox and IE. The OS can be different.

I finally got this to work for the H2 background color. The first big mistake I made was I copied the color code for my normal background into the H2 background-color - DUHHH! Well when I realized that and put in a different color code it worked. Here is the code for anyone interested so you can see how I did it. Note that I removed the H2 declarations from the general declarations at the top but that is not necessary as when you redeclare H2 properties it seems to take what you specify later. I will still need to figure out why the HR declarations don't all work but I can deal with those by html in the descriptions anyway.
_________________________________

<setvar color1 = #77280D>
<setvar color2 = #F5D0A9>
<setvar color3 = #A41F39>
<setvar color4 = #DF013A>
<setvar color5 = #A41F39>
<setvar color6 = #F50202>
<setvar color7 = #DF013A>
<setvar color8 = #FFEBC1>


DIV,BODY,TD,TH,TR,TABLE,FONT,INPUT,LI,UL,FORM,
BLOCKQUOTE,P,B,I,H1,H3,H4,H5 {
font-family: arial,helvetica,sans-serif;
color : <getvar color1>;
background : <getvar color2>;
}

H2 {
font-family: arial,helvetica,sans-serif;
color : <getvar color1>;
text-align: center;
background-color: <getvar color8>;
}

A:link { color : <getvar color3>}
A:active { color : <getvar color4>}
A:visited { color : <getvar color5>}
A:hover { color : <getvar color6>}

.caption {
font-size : 14pt;
color : <getvar color7>;
font-style : italic;
}


Board index PBase HTML and Style Sheets CSS declarations don't all work.

Who is online

Users browsing this forum: No registered users and 1 guest