changing font of gallery name and description changing font of gallery name and description
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

changing font of gallery name and description

Started by alanpalan, November 12, 2007, 04:48:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alanpalan

I want to change the font of gallery name and description (in header of Coppermine). Whad do you recommend? Do I have to change it in template.html or is there some more appropriate way how to do it?

Joachim Müller

template.html is the place to change if you want to assign a different CSS class.
style.css is the file where you should add your actual format.

Example:

if you currently have this in your template.html file:              <h1>{GAL_NAME}</h1>
              <h3>{GAL_DESCRIPTION}</h3>
and want to control/change the font size, change it to              <h1 class="gallery_name">{GAL_NAME}</h1>
              <h3 class="gallery_description">{GAL_DESCRIPTION}</h3>
Then modify style.css by adding this.gallery_name {
    font-size:16px;
}
.gallery_description {
    font-size:14px;
}

Alternatively, you can assign the style inline as well by replacing              <h1>{GAL_NAME}</h1>
              <h3>{GAL_DESCRIPTION}</h3>
with              <h1 style="font-size:16px">{GAL_NAME}</h1>
              <h3 style="font-size:14px">{GAL_DESCRIPTION}</h3>

Got the idea?

alanpalan

Yes, I got it. Thanks. But first of all I want to change the font to "Comic Sand MS" (or something like that). So, I should attach to the css file this?

.gallery_name {
    font-family: Comic Sand MS ;
}

Joachim Müller

You can only use that font if it is installed on the the client computer. Since you can't say that for sure, it's not a bright idea to use a proprietary Microsoft-font. If you want my personal opinion: don't use Comic Sans at all: it's a lame effort to make your site look different, and there's no good fallback. Anyway, if you insist to use that font, you have to make sure to provide a safe fallback and to put the name of that particular font into quotes. Subsequently, the line of code you posted above should read.gallery_name {
    font-family: 'Comic Sans MS', Arial, Helvetica, sans-serif;
}
The browser will then render the corresponding output using that font if it is installed on the client and fall back to Arial. If Arial isn't available, it will use Helvetica. If Helvetica isn't available, it will use any sans-serif font available on the client's operating system (specified in the browser's preferences).
However, this isn't related to Coppermine at all, but plain CSS knowledge. This board is not dedicated to teaching users CSS - you better read this up somewhere else. In fact, I can only recommend to spend some time on learning CSS. If you don't, you'll end up with a page that will look fine on your client only and will look like sh** on everybody else's PC.

alanpalan

Ok, maybe it would be better to put there graphic logo (with another font).

Joachim Müller

In terms of being fail-safe: yes. In terms of search-engine-friendliness, accessibility and bandwidth-use: no. If you ask me: a gallery is already full of images (that's expected behaviour) - cluttering the theme with even more images is not a bright idea. Anyway, issue solved, case closed. Usually, people say "thank you" after getting a detailed answer...

alanpalan


alanpalan

(When you mark this threat as "solved", I thought you would not come back here :)