Jump to content

Recommended Posts

I'm doing a basic html website for a gym. Not really familiar with .php but the IT Guy they have gave me a page where I guess the owners can login and change the schedule page whenever they want.

 

This is find as I just re-designed the php page to match the new layout. BUT I'm having a problem now....

 

I dont know what I did but when I upload the file and refresh the page I am receiving this error....

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/brickhau/brickhausfitness.com/schedule.php:1) in /hsphere/local/home/brickhau/brickhausfitness.com/config.php on line 7

 

 

ALSO....

He has this code in it that changes the month....

 

<h2><?php echo strtoupper(date("F", $now));?></h2>

 

^^^^ How can I make that a different color from the default black?????

 

 

HELP PLEASEEEEEEEEEEEEEEEE

Link to comment
https://forums.phpfreaks.com/topic/144933-need-php-help-fastdeadline-is-today/
Share on other sites

tr this

<p class="red">

<h2><?php echo strtoupper(date("F", $now));?></h2></p>

 

or

 

<span class="red"><?php echo strtoupper(date("F", $now));?></span>

 

and use css to create the class and set the colour and size from there...remember to link the css to the page

 

all the best

Open up a text editor. Save it as .css

 

in the css file put

 

h2
{
  color: red;
}

 

Then after you save it put this into the <head></head> section

 

<link href="styles/default.css" rel="stylesheet" type="text/css" />

 

Change the href location to wherever the .css file is located.

Bad markup placing a <h2> within a <p>.

 

You may not want to have

 

h2
{
    color: red;
}

 

... as if you have more than one <h2> it will change that as well. Give the h2 a class (ie. <h2 class="red">) then change the CSS to:

 

.red
{
    color: red;
}

 

Adam

With you so far.

 

How do you use css to create the class and set the color....if you could direct me to a tutorial or something.....

???

 

You're trying to re-design a site's layout, but you don't know CSS?  Good lord....

 

CSS stands for Cascading Style Sheets.  It's the technology standard for formatting HTML documents.  Like HTML, CSS is simply text that the browser reads.  This text is essentially a bunch of formatting rules in order to modify the look and feel of HTML elements.

 

Instead of using horribly outdated code, like <font> tags or what not, all of the formatting is placed in an external CSS file that the HTML file loads.  There are three main selectors that one can use in order to specify what element(s) they want to format:

 

1. Tag name.  The following code will turn the text of ALL paragraph tags (<p>) red:

p { color: red; }

 

2. Unique id.  If you give an element a unique id, then you can format just that one element:

#firstName { font-weight: bold; }

 

All id's begin with a '#' character within the CSS.  In order for this to work in the HTML document, there needs to be an element with that id:

<span id="firstName">Bubba</span>

 

3. Class name.  You can group elements together by making them a member of a class.  This is simple to do:

.bookTitle { font-style: italic; }

 

Classes are denoted by the '.' character in the CSS.  In order for this rule to be applied to HTML elements, you must give them a class attribute:

<span class="bookTitle">Pro JavaScript Techniques</span> by John Resig
<br />
<span class="bookTitle">PHP For the World Wide Web: 3rd Edition</span> by Larry Ullman

 

Where do these rules go?  The simplest thing to do is create a .css file and put them all there.  Then, within the <head> element of your HTML document, you can simply write:

<link rel="stylesheet" type="text/css" href="styles.css" />

 

So long as you have a file named 'styles.css', and it's in the same directory as your HTML document, it'll all link up.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.