Jump to content

talksr

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

talksr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks phpQuestioner, it works very well. Could you explain to me how the code is getting that colour to display? There seem to be a few functions.
  2. Oh I see, I was baffled as to why it was there! Thanks dave P.S. Nice site you seem very gifted in Animation
  3. I have been using the style property of an element to to change style properties for an element. I want to add another button and the corresponding Javascript to change the background colour for para2 (which is my second pharagraph). How can I do this? <html> <head> <style type="text/css"> #para2, #para3 { backgroundcolor: red; } </style> <script type="text/javascript"> function show_para1_status_win() { var oPara1=document.getElementById("para1"); window.status=oPara1.innerText; } function clear_status_win() { window.status=""; } </script> <title>Using the dom</title> </head> <body> <h1>Using the DOM</h1> <p id="para1">paragraph one text here</p> <p id="para2">paragraph two text here</p> <p id="para3">paragraph three text here</p> <hr /> <input type="button" name="Button" onClick="show_para1_status_win()" value="Show para1" /> <input type="button" name="Button" onClick="clear_status_win()" value="Clear status" /> <hr /> </body> </html>
  4. Hello, I have created a 3 collumn plus masthead web page layout using css exclusively to set the layout. Here is my css code: /* CSS Document */ body, html { margin: 0; padding: 0; font: 11px tahoma, arial, serif; } #container { margin: auto; padding: 0; width: 760px; border: 1px solid #000000; } #header { width: 760px; height: 120px; border-bottom: 1px solid #000000; } #left { width: 180px; float: left; height: 500px; } #middle { width: 398px; float: left; height: 500px; border-left: 1px solid #000000; border-right: 1px solid #000000; } #right { width: 180px; height: 500px; float: left; } br { clear: both; } And here is my html: <!-- HTML document --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>CSS page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css.css" rel="stylesheet" type="text/css"> <!-- link to css file --> </head> <body> <p> </p> <p> </p> <div id="container"> <div id="header"></div> <div id="left"></div> <div id="middle"></div> <div align="center"></div> <div id="right"></div> <br/> </div> </body> </html> <!-- end of html --> My question is, how can I extend the css to enable an appropriate text only masthead and the center column to appear in print?
  5. Ok Davestewart, could you explain what this does in the code you did? <link href="base_style.css" rel="stylesheet" type="text/css"> <link href="<?php echo $stylesheet; ?>" rel="stylesheet" type="text/css"> Where does base_style.css come from? :-\
  6. That's ok davestewart, could you explain to me on your idea what this does: Code: <link href="base_style.css" rel="stylesheet" type="text/css"> I can't see where base_style comes into it?
  7. Thanks for your post, it seems a better way but I can't get it to completely work. At the moment, a selector drop down is appearing at the top of the page with the values of my array, but it has a >? at the end of it and I can't see where it has come from and also it doesnt seem to pickup my two stylesheets style1 and style 2, I obviously don't expect it to pick up Cool and Warm. <html> <?php $styles = array("style1","style2","Cool","Warm"); ?> <?php echo "<select name=\"style\">"; foreach($styles as $key => $value){ echo "<option value=\"".$key."\" >".$value."</option>"; } echo "</select>"; if(array_key_exists ($_POST['style'],$styles)){ $style = $styles[$_POST['style']]; } else{ //default case $style = "default"; } echo "<link href=\"".$style."\" rel=\"stylesheet\" type=\"text/css\">"; ?> ?> <head> <title>ServerSide Scripting</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="858" height="347" border="1.5"> <!-- Below are the three collumns of text --> <tr> <th scope="col"> <h1>test </h1></th> <th scope="col"> <h2>test </h2></th> <th scope="col"> <h3>test. </h3></th> </tr> </table> </body> </html>
  8. Thanks thats really helpful, thank you for your time. Could you finally just explain what this line does? <link href="base_style.css" rel="stylesheet" type="text/css"> I can't see where base_style comes into it? :-\
  9. Thanks for your post, it works well. Could you explain to me how it works? :-\ Like whats going on on these lines.. <?php $n = $_REQUEST['style']; if($n != ''){ $stylesheet = "style{$n}.css"; } ?> And on these lines: <link href="base_style.css" rel="stylesheet" type="text/css"> <link href="<?php echo $stylesheet; ?>" rel="stylesheet" type="text/css"> I am guessing it inserts which ever stylesheet is in the url onto the page so it can be used.
  10. Thanks for the help, but I can't get it to work This is my code: <head> <title>Page Title</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> <link href="style2.css" rel="stylesheet" type="text/css"> <?php if(isset($_REQUEST['style']) && $_REQUEST['style'] != '') { echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.mywebsite.com/css/style".$_REQUEST['style'].".css\" />"; } else { echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.mywebsite.com/css/base_style.css\" />"; } ?> </head> When I load the url like this: http://webhost/index.php?style=2 or http://webhost/index.php?style=1 It only loads the stylesheet values for style2.css
  11. Thanks pocobueno1388,and everyone else for your help
  12. Thanks for all of your help, thats super. Is there any way you can explain to me what is happening on these lines: for ($i=3; $i<100; $i+=2){ and also if ($cols == 5){ echo '<tr>'; $cols = 0; }
  13. Thanks, looks good. If I wanted to add columns what could I insert into the php code, so say I wanted to use 3 or 5 columns to make it easier to fit on the page?
  14. I know how to create a table, but not how to get the numbers into the table. I have no preference as to how the table looks, just want to try some things out really. Any help would be great.
×
×
  • 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.