Jump to content

cssfreakie

Staff Alumni
  • Posts

    1,674
  • Joined

  • Last visited

Everything posted by cssfreakie

  1. Hmm, the script i posted above doesn't work for some reason. Here is one that does I used in_array() instead. <?php if ( isset( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ) ){ $languages = strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ); // $languages = ' fr-ch;q=0.3, da, en-us;q=0.8, en;q=0.5, fr;q=0.3'; // need to remove spaces from strings to avoid error $languages = str_replace( ' ', '', $languages ); $languages = explode( ",", $languages ); // do something when you don't like the language $lang_array = array('ko','ru-md','ru','zh-cn','zh-hk','zh-mo','zh-sg','zh-tw','zh','ne'); if (in_array($languages[0], $lang_array)){ echo 'bad stuff'; }else{ echo 'good stuff'; } } ?>
  2. I quickly made this hope it can be of help. <?php if ( isset( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ) ){ $languages = strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ); // $languages = ' fr-ch;q=0.3, da, en-us;q=0.8, en;q=0.5, fr;q=0.3'; // need to remove spaces from strings to avoid error $languages = str_replace( ' ', '', $languages ); $languages = explode( ",", $languages ); // do something when you don't like the language switch ($languages[0]) { // first array item case 'ko': // korea echo "do something or set a variable"; break; case 'ru-md'||'ru': // russia echo "do something or set a variable"; break; case 'zh-cn'||'zh-hk'||'zh-mo'||'zh-sg'||'zh-tw'||'zh': // china echo "do something or set a variable"; break; case 'ne': // india echo "do something or set a variable"; break; default: echo "good"; } } ?> -edit i used that script i linked, as far as the language codes, there are quite some more in there, so in case you might want to have a look at it.
  3. what do you mean results are the same. could you be a little more precise in what exactly is the same. Why are you even floating the paragraph? have you make got it online somewhere, maybe the stuff inherits properties from you sytle sheet without even knowing it. Look here for an example working Explanation on it can be found here Note though I use a reset.css for everything. You might want to do the same, since a paragraph has some default margin's at the top and bottom. -edit: is it solved??
  4. Well i am pretty sure it's faster! and has the same level of reliability, Ip addresses aren't reliable. So if you realy want to block people, let them pay for access and is this done for spam attacks, use tokens and captcha and logins edit: and airstrikes
  5. i see i made an error </s> should be </strong> no reason why it's got copied like that.
  6. So if you would have read both articles above you could have made something like this: <body> <style type="text/css"> div.media-box{ float:left; margin-right:10px; overflow: hidden; background:#0055BB; padding:3px; border:1px solid #fff; color:#fff; } .media-box img{ float:left; margin-right:5px; } </style> <?php for($i=0;$i<80;$i++){ $num = $i+1; echo '<div class="media-box"> <img src="http://i55.tinypic.com/2d962ww.png" alt="" /> <strong>This is a title</s> <p>this is some text, lalalala lalalala lalalala lalalalala lalalala</p> </div>' ; } ?> </body> just run it it works out of the box
  7. yes don't use tables for this unless you know when to use them. What i would suggest is to make a nice media box, in a div. <div class="media-box"> <img src="image.jpg" alt=" " /> <h2>title</h2> <p>some text</p> <div> Let php provide the content. Than in css set a a standard width and height for the div and let it float left; let the image float left and give it some margin-right so it doesn't touch the text That's what i would do since it's much more clean. it uses pretty much the same technique as here. but it uses an extra float on the image. Hope it helps.
  8. Yeah i saw it works. and apart from the missing end tag of <img>. it's also correct. all html elements when using a xhtml doctype require an endtag. <img src="image.jpg" alt=" " /> anyways good job, it looks nice on your site. You can do the same technique on the text that that sits between images.
  9. I am not sure if this could be a good way, but what if you use the user language instead of a zillion ip addresses. If you know how to detect the language you only have to check if it's one of those 4 cases. Ofcourse people can spoof the useragent, but so can they with ipaddresses. I found a script for you, it's meant for something different, but i bet the right components are in there to get it started. http://techpatterns.com/downloads/scripts/php_language_detection.txt Hope this helps!
  10. I'll have a look. and say what i would do. Note though: i see you use in line style, it's a bad practise! And yeah i design off-line too, but for css and layout, some visual reference is pretty vital
  11. Hi Codarz, This is quite a difficult thing really, because i assume you are using a background image on your body right? There are several ways to this, but you should before designing something realize that people have different screen sizes. Because of that it's pretty much impossible to make a background image (on the body) look the same on all screens. Also, what you didn't provide is how you tried it. Is the image stretched or does it stay the same size? Do you have it online somewhere so i can have a look? There are quite some ways to do this, although they all depend on the end user. Some ways to think about/ play with: Set html, body {height:100%; width:100%;} and place an image in the mark-up and set the height to 100%; make a div the size of the window, and set the image fixed 50% 50% background: url('image.jpg') fixed no-repeat 50% 50%; Or google for background image 100% in case you want to stretch it.
  12. Hi there, the code you posted is pretty much invalid. I would recommend to use a nice editor that tells you this. a good editor i use myself is netbeans its free also. now back to your code: you are doing this : <> that doesn't mean anything really. All* elements in html require an end-tag so for a div-element the start-tag is <div> the end-tag is </div> and for a p-element the start-tag is <p> the end-tag is </p> See the / in the end-tag? all* end-tags have that. So in your situation you are using a div in a div (nested elements) so it could look like this: <div id="outer-div"> <div id="inner-div"></div> </div> By using indentation you can easily view which start-tag is the "partner" of which end-tag. Any-time an element is a nested child, you make an extra indentation. <div class="footer"> <div class="footertxt"> <div class="footerme"> </div> <div class="footerright"></div> <div class="footerimgmail"></div> <div class="footercopyleft"></div> <div class="footercopyright"> <div class=" "></div> </div> </div> <!-- closes footertext --> </div> <!-- closes footer -->
  13. oh sorry i meant: if I were you I would post it in the javascript section. sorry for the confusion You could this with css, but that is loads more complicated.
  14. i would be too without looking:http://tinyurl.com/4fb54xd
  15. Hi crmamx, Good you made it to work, too bad though that you did not took the effort to post the answers because that would help in figuring this out yourself. And if code is correct or not depends on the situation. Just assuming something is a tutorial and thereby good is the same as assuming any car is able to transport you. That developer that referred to it was me btw (no shit ..) if interested i wrote a little article with minor comments (how and why). http://cssfreakie.blogspot.com/2011/03/making-photobook-layout-with-float.html
  16. if the clear:both doesn't work for you, you could also set the height of line-height to the same size of the input element. (assuming you use a <ul>-list (which i would use) But clear:both should work in your case. so in case input{ height:1.5em; } ul{ line-height:1.5em; } Anytime you use float and for some reason elements are aligned just a few pixels under each other in a diagonal way, clear is the solution.
  17. a sample of what i mean can be found here: http://cssfreakie.webege.com/monkeybook.php adjust the window size to see the power of floats. but please answer the questions and i'll provide the code if still needed. (but ones you answered it it should be a piece of cake)
  18. small tip aside try to put any text within tags . Right now your text is just sitting in a div (without a <p> or <span> or anything else), which makes it hard to target. Btw watch your <br> tag I am pretty sure you use a strict doctype. so it's <br />) Anyway for your question i think you should consider the following: how can I make multiple objects float next to each other (even if they have contents). If you think float, you should think about a block elements. Have a look at the image. and answer the following. What do you think will change or stay the same the width or the height of the div? (or maybe even both) How would we align the inner content of the div? Would apply that alignment style to the div or to each element within? (hmm to each sounds redundant) Post me the answers and i'll adjust it for you practise makes perfect. [attachment deleted by admin]
  19. ah that is indeed something different. That's why it's always good to be more precise. well the easiest way to do this is with javascript. I would post this in the javascript section. Pretty much what happens if i can see it correct is that on mouse over the image a <span> becomes visible and on mouseout it displays none again.
  20. oei, Doe you mean if you hover over an image to show the text "more info" or if you hover over text to show the image? Anyway i think you mean the first in that case you can use the title attribute; <img src="myimage.jpg" alt="image is gone" title="more info...?" /> If you were to mouse over this image a small pop-up would show more info..? You can also style the title another way would be this: http://www.communitymx.com/content/article.cfm?page=1&cid=4E2C0
  21. hmm, maybe try something like this: input{ clear:both; } Problem is is that the text has a different height than the input box, by using clear both it will push the other floats on the other line. Why are you using separate div's by the way? An unordered(nested) list is ideal for this (just do list-style:none;) as far as the code just above me if you use it, be careful for the double semicolons. I saw at least 3 of them.
  22. Btw in case this place your linking to is a static one (which i think for some reason it is since it's an airstrip) You might as well make a print-screen (image) of it and slice it the way you want. that way you wont have to use anything difficult.
  23. well compatibility i am not sure about that if your page brakes in IE 8 something is really wrong. Maybe run it through the w3cvalidator. http://validator.w3.org/#validate-by-input I hope you realise that the code above with the extra php won't help us alot. php is a server side language. also you are missing a an endtag for <body> and a closing tag for <html>
  24. that your old site may have been crap doesn't mean you should banish iframes for everything certainly if there is no alternative. Which i think is the case now. at http://www.aardvarkmap.net it seem they give a 3 step way to implement it. make sure your width match. include seems to not work here since your host won't allow it but i think most host won't
  25. They use a technique called cufon for that. maybe want to have a look at it.
×
×
  • 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.