Jump to content

cssfreakie

Staff Alumni
  • Posts

    1,674
  • Joined

  • Last visited

Everything posted by cssfreakie

  1. do you have an online example? easier to see what is going wrong for me. Beides that some of your #id's start with a number, that is invalid. #1, #2, #3
  2. you have a # inside them instead of a url for example: <a href="#">Top Players</a>
  3. I understand, but it was an example, the logic stays the same. May I assume that the value you want to output is $msg? if that is the case this should do the trick. //for the invalid message $msg = '<span class="invalid">Folder already exists in database. Try another one.</span>'; //and for the valid message $msg = '<span class="valid">Folder was successfully added!</span>'; Note i am using single quotes around the strings. May I also assume you know how to add those classes in a stylesheet? if not let me know
  4. I was already typing, send me an export file happy to test it because I was pretty sure it would work lol. Good luck with the game
  5. well that should be doable. Can you show us the script you say you are struggling with? If you don't have one. I recommend you first have a look at the database handling tutorial and move from there on.
  6. Ah if i am correct you require distinct for that. You might want to check this out: http://www.sqlcommands.net/sql+distinct/
  7. Hi Damion, with code we mean relevant code. The above is a complete script one needs to read through to find some clause which in your case needs to output succes or failure. Since I rather narrow it down to a more concrete example here is something you can do with the thing mentioned by Mikesta which is assigning a class rather than in line style after you tested the value. So here goes: the php: $variable_to_test = 'monkeys'; //test the value if ($variable_to_test == 'monkeys'){ // if equal to echo '<span class="valid">the value is indeed equal to monkeys</span>'; }else{// so in case it's not equal to echo '<span class="invalid">the value is not equal to monkeys</span>'; } Than in an external stylesheet you must create 2 classes valid and invalid span.valid{ color:green; font-weight:bold; } span.invalid{ color:red; font-weight:bold; } By doing this you separate style and logic which will save you loads of time in the end. If you have questions let me know.
  8. I could be totally not understanding you, but as far as I can see the only thing that happens now is that you create a temporary table by joining them. If you were to narrow it down to something useful you need to narrow it down by for instance adding a where clause. That is what the search should do in the end right?. You narrow it down by using either the game type or the game it self SELECT gamertags.*, games.*, game_type_preferences.* FROM gamertags LEFT JOIN games ON gamertags.user_id = games.user_id LEFT JOIN game_type_preferences ON gamertags.user_id = game_type_preferences.user_id where game_type_preferences.gametype_pref_id = 2;
  9. in addition to the above, I made a blog post with some explanation, since i am pretty sure there are more people that could use the above. You can also see a live example there.
  10. well to repeat myself a little normally it requires a container with a fixed width to do this. Now in you're case your using percentages. As you know percentages are fluid (relative) and not fixed so you need to figure out how to still combine the percentages and the fixed width of the 2 images so there is enough space for them to sit on the same line. Have a look at the code below. I reproduced what you made (but working) without the use of positioning other than static. Now notice, I wrapped a little container around the middle image and set a margin left and right of 50 pixels (the same width of the outer images). this allows them to sit on the same line while the middle image can stretch it's butt off. I recommend to read through this code and recreate it out of your head, because this is not seen in most designs, and the trick with the margin can be very useful for other situations. good luck! *and don't forget to mark it solved when it solved it for you <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link type="text/css" rel="stylesheet" href="css/style.css" /> <title></title> <style type="text/css"> body{width:100%;} #wrapper{ width:90%; margin:0 auto; } #middle{ margin:0 50px; /* some space for the left and right image */ } #middle img{ width:100%; height:50px; } #header img{ float:left; } </style> </head> <body> <div id="wrapper"> <div id="header"> <img id="left" src="http://templatetester.webs.com/images/left.png" alt="" /> <div id="middle"> <img src="http://templatetester.webs.com/images/bar.png" alt="" /> </div> <img id="right" src="http://templatetester.webs.com/images/right.png" alt="" /> </div> </div> </body> </html>
  11. Well if you want to change the value of a variable by clicking on a link you need to append a $_GET variable to that link. Just as a demonstration the following will result in a different value when you click the links. Try that out as is so you see what is going on. <?php //some standard error reporting, remove on a live server error_reporting(E_ALL); ini_set("display_errors", 1); $id = 1; // giving a default value, could be anything if(isset($_GET['id'])){ // isset checks to see if the $_GET variable id is set $id = $_GET['id']; } ?> <a href="?id=1">kate</a> <a href="?id=2">pete</a> <a href="?id=3">steve</a> <a href="?id=4">kate4</a> <a href="?id=5">pete5</a> <a href="?id=6">steve6</a> <br /><br /> <?php echo 'the value is now: '.$id; ?> So if you want you can just put $id in the database query. There is only one catch: the value can not be trusted since the end user can change it. So before you apply this, read the security tutorial http://www.phpfreaks.com/tutorial/php-security
  12. it could be cache indeed, something you might want to add in an .htaccess file on your server is the following # Sets the cache control for 1 week <FilesMatch "\.(css|jpg|png|gif|swf|js)$"> Header set Cache-Control "max-age=604800, must-revalidate" </FilesMatch> # turn on the module for this directory ExpiresActive on # set default ExpiresDefault "access plus 24 hours" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType text/css "access plus 1 months" ExpiresByType text/javascript "access plus 1 months" ExpiresByType application/javascript "access plus 1 months" ExpiresByType application/x-shockwave-flash "access plus 1 months" the article on the example given above is: http://www.flingbits.com/tutorial/view/improve-your-sites-performance-with-apache
  13. on line 128 of your style sheet add the property I commented on: #top_btns ul.sf-menu { float: left; list-style-type: none; margin: 0; text-transform: uppercase; z-index: 100; position: relative; /* <--------- I added this */ } The z-index property is meant for objects with a position other than static, so if you just give something a z-index it wont work, because they are static objects by default. if this solved it for you please mark it solved cssfreakie
  14. well clearly something is wrong in terms of the z-index. Do you have an online example. much easier fixing these types of things.
  15. mark your topic solved mate, saves others reading through
  16. trust me i sometimes say things for a reason, don't see it as a personal attack. Using the pre tag makes no sense, blaming the age of the code doesn't justify crap. you either need to keep them on the same line (in your code) or if you ignore that (they are in line elements) for certain reasons, you can assign the property of float to them. Well you need to wrap them in a container that has a fixed (so not fluid) width that is sufficient. So if you have 3 images of 30px it should be 90px. But again when posting code in the css/html forum quite some stuff we don't see like the dimension of images. so it's kinda hard to imagine how it will look or suggest better methods. For now i am pretty sure the use of that position relative in your code is madness, but if I would see an on-line example i could back it up easier. Hope the above helps.
  17. When learning new things it's often better to try out that knowledge in a clean environment. So start with a clean slate. (and don't think what you made is worth keeping or that it's a waste if you ditch it ) Soon you can write this out of the top of your head. Lets look at your image. you have a header and than 3 divs below it that sit next to each other. If you just tried out the float property on a clean slate you would have noticed that float is needed to let block elements sit next to each other and clear is to kick other object of that line. try out the following and look at the logic in it. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link type="text/css" rel="stylesheet" href="cssa/style.css" /> <!-- i used stuff in style tags, but always use an external stylesheet --> <title>floatstuff</title> <style type="text/css"> #wrapper{ /* a container to target everything at ones */ width:966px; margin:0 auto; /* center page */ border: 1px solid #eee; overflow:auto; /* shrinkwrap around everything */ text-align: center; } #header{ width:962px; height: 80px; clear:both; /* do you understand why we use clear here? is it really needed here? and what if the header was smaller in width?*/ border: 2px solid yellow; } #left, #middle, #right{ /* makes 966px */ width:310px; /* makes 930px */ margin:4px; /* so that makes 24px .... You understand why? */ border: 2px solid yellow; /* makes 12px */ float:left; /* using just float left keeps things more organized than mizing up float left and right */ } </style> </head> <body> <div id="wrapper"> <div id="header">header</div> <div id="left">left</div> <div id="middle">middle</div> <div id="right">right</div> </div> </body> </html> P.s. although you said you read the tutorial which is a huge with loads of examples. I recommend you read and test it for real. Understanding the float property takes time.
  18. can you give 1 valid reason to bypass everything that has been said to use <pre> ?
  19. yes, if i inspect it with firebug, the size of both seems to be the same. Maybe try this out outside of such code sharing environment. It could very well be that some other things are disturbing the outcome. i have a free host were i can test stuff, maybe worth to try out yourself.
  20. I have a hard time imagining how this will look in the end. Got an online example. For now all i can say is that some elements you position by using left and others you don't position.
  21. As far as i can see it already spans the the whole width. As far as IE6 you might want to try and add display:inline to each element that has a property of float.
  22. Don't forget to mark it solved, saves other time reading through
  23. If it's solved please mark it solved, saves others time looking into the matter.
×
×
  • 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.