Jump to content

DarkxPunk

Members
  • Posts

    465
  • Joined

  • Last visited

Everything posted by DarkxPunk

  1. If I am not mistaken to contain would you not use overflow: hidden on the container? Once I see the mockup I will have a better understanding I suppose.
  2. Hey everyone, So when you check out http://stackoverflow.com (hey even the forums does it too) you will notice that as you zoom the page the content does not try and flow down, but rather enables scrollbars allowing you to scroll left and right. How do you do that? Thanks for any help.
  3. Hey everyone, So I am trying to incorporate this menu (http://codepen.io/jetpacmonkey/pen/ktIJz) into my website (with the tweaks as needed) but I find this one set of styles that is both illegal, and I can't make it function either way... #main-nav-check:checked ~ .page-wrap { width: 80%; .open-menu { display: none; } .close-menu { display: block; } .main-header { width: 80%; left: 20%; }} What am I missing or misunderstanding... I need the menu to use this code cause when :checked is set I need other elements to change... Any help is appreciated, thanks.
  4. So... I figured it out, just after I posted this... The solution is so simple I now feel stupid, but I doubt I will be the only one to make this silly mistake, so I will keep this posted incase someone needs it... Now the solution... Since divs with max-width and floats can't do this, the solution is @media queries. #left,#right {width: 50%;float: left;}@media screen and (max-width: 640px) {#left,#right {width: 100%;min-width: 320px;float: none;}} Now how does this work? Well basically so long as the page is larger than 640px (min-width: 320px * 2) than the float: left with a 50% size will keep both left and right side by side and over 320px in width each. Great. Now once you pass this 640px limit (say when you resize the browser or use a iPhone in landscape, or portrait) then the float turns off, drops the right div underneath and it fills the rest of the screen's width. What are the uses, well in my case I have a logo on the left of my page, and a navigation bar on the right. As soon as the page shrinks I need to keep them both visible and consistent looking, especially since my navigation bar looks like tabs. So when it gets too small to fit my nav bar it will just drop it down and fit. Yay.
  5. Hey, been awhile... So I am playing around with fluid/responsive website design and I have hit a block relating to Max-Width being ignored when using Float. I know this is just how it is (honestly I can't understand the logic of why though), but is there a way around it? Simply I got this: <div id="wrap"><div id="left">Content</div><div id="right">Content</div></div> #wrap {width: 900px;}#left,#right {max-width: 450px;min-width: 320px;float: left;} The result is both #left and #right become 320px wide divs floating left... To outline quickly what I want to happen just incase I am approaching this all wrong... I want the two divs side by side until both of them squeeze down to 320px as a result of a different device screen size or the shrinking of a browser window. After this the right div will drop under the left div and they both will resize to fill the remaining space until again they are squeezed down to 320px... Thanks for any input.
  6. I am curious what people prefer, and yes JS is a option, but that is not always an options for all users so php can do the job.So is it better to use dynamic CSS, like em and percentage or make different CSS files for different devices and have php assign them?Be great to hear feed back.
  7. Found one solution: * {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}, but its obviously not completely compatible. Any other solutions?
  8. Hey everyone,So I am getting back into things and trying out dynamic layouts using only CSS and well I seem to have hit a probably basic hurdle, and can't seem to figure it out... So Dynamic layouts and borders. Problem is the width of a box element does not include the border so when I say for example make a element 20% 60% 20% and add a border to every element. Well it don't fit side by side because borders again are ignored in width calculation. Obviously I could change it to 20% 59% 20%, but thats not a real solution. Maybe there is even a better way. Any help appreciated.Peace.
  9. Hey there, So the title may be deceiving, but I think this can be achieved using JavaScript. My goal is to have a QR code that runs a javascript. What will happen? Well my idea is that since not everyone scanning a QR code may have internet access at said time, it would be a great to have a failsafe. The failsafe would be, if there is a internet connection then go to url x, if not load a event card. In my head it seems simple, but I can't figure out how to achieve this. First off I know you can put as a url in the QR code to be "javascript:SomeJavaScript" but what is the power of that? Can I have it try to bounce off a server and if receive false to load the event card? Please any help is appreciated,Thanks.
  10. There is two ways, JS or AJAX. Since I doubt your doing databases JS will do. function hideShow(a) {var element = a.parentNode.nextSibling;while (element.className != 'hideShow') {element = element.nextSibling;} element.style.display = element.style.display == 'none' ? 'block' : 'none';a.innerHTML = a.innerHTML == 'Show' ? 'Hide' : 'Show';} You will need to create two divs. One to hold the beginning of the text and the read more button, the second div will hold the new content that can be read. Pretty simple. It can also be p tags too, just make sure both tags are the SAME! After that give the anchor a onclick="hideShow(this)" the second tag a class of hideShow and a style of display: none. All done Any questions just ask
  11. Hey everybody. I am probably way over my head on this project, but I hope from your assistance I can learn. So I am attempting to create a automated php page that will take the path of images in directories and print into an img tag to display the images. So far I am here: <?php $dir = 'images/artwork';$dir_items = new RecursiveDirectoryIterator($dir); foreach(new RecursiveIteratorIterator($dir_items) as $items){if(!$dir_items -> isDot()){$items = str_replace("images/artwork/", "", $items);echo $items . "</br>";}} ?> This gives me the name of the directory which I need to label the files and the full path for the files I need. So my idea is when an image is displayed it will look as so <img class="large" src="$imag_path_based_on_file_name" alt="$dir_name_for_imag"> etc etc. I am not sure how to pull the directory name, or sort the file names as needed. My idea was maybe to create an array for each directory to look as so [0] First Directory Name-> [0] full.png-> [1] large.png-> [2] small.png[1] Second Directory Name-> Etc, etc Then I would proceed as so <img class="$img_name" src="$img_directory $img_full_name" alt="$img_directory"> Maybe I am over complicating things. I just need some pushes in the right directions, and maybe some code. Thanks for any help
  12. Almost all cms have templates, joomla, Wordpress, the list goes on. It's to make the sites look pretty, but sadly they sometimes lack compatibility making sites look crude and unprofessional. Personally I hate cms(s).Now for memorization, it will come with time. Try and remember them all. The more you use them, the quicker you will remember. But you always got w3schools here to help when your memory falters.
  13. Width is too wide for the search area. Fix that and tell both the image and search field to float left. Problem solved.
  14. You can easily change anchor text changing all anchor tags to have a color of black.a {color: #000000;} but that will also change all your other links.If you provide all your CSS, and all your code I can see where there is maybe a slip up to solve.
  15. Hey everyone so I have two pictures Box model ideal:Box model real:As far as I understand box model the ideal should happen, but the real happens... Why? Anyway around it? BLAH! I know you can use padding, but it does not make sense Thanks for any help. -EDIT- Gotta set the wrapper to overflow anything other than visible. Still silly. Stupid collapsing.
  16. Okay I got it working and am begining to understand. Now what I would like if I could associate my content to say its date that I pull off the database. The reason is so I could simply type echo $row['date'] and get the associated content.I found it once when I was looking for what you gave me, but now after a few hours of searching I can't find it X(Thanks for any help.
  17. I have been researching and keep finding the same solution to my problem, but when I implement them I don't get the results. $con = mysqli_connect($db_host, $db_user, $db_pass, $db_name); $request = mysqli_query($con, "SELECT article_content FROM articles");?><!doctype html><html> <head> <title>Search Protocol</title> </head> <body><?php $result = array(); if(mysqli_num_rows($request) > 0) { while($rows = mysqli_fetch_assoc($request)) { $result[] = $rows['article_content']; echo $result; } } With this I get, arrayarray. What am I doing wrong?
  18. Good practice is to always reset your basic elements. For example at the top of your CSS you could have something like... html,body,img {margin: 0;border: 0;padding: 0;color: #000000; /* Or whatever font color will be dominate */font-family: arial; /* Or whatever font family will be dominate */} Over time you will add more resets, and maybe even have different groups if elements resetted in certain ways, such as maybe removing all list formatting for uls and lis etc.What I posted in code will solve your problem FYI.
  19. I understand exactly what it is doing, and my question is why? Should it not put all the results into one array? Why is it not, and how do I make it do so?
  20. That's great actually I will need that in the future. But specifically I usually see arrays show like index[0] "first row" index[1] "second row", but it shows both as 0...
  21. Thank you, now I wanted to quickly look over a var dump to see how to maybe select an individual row but I get this array(2) { [0]=> string(30) "This is a test article." ["article_content"]=> string(30) "This is a test article." } array(2) { [0]=> string(25) "Other test content" ["article_content"]=> string(25) "Other test content" } I am using this $request = mysqli_query($con, "SELECT article_content FROM articles");?><!doctype html><html> <head> <title>Search Protocol</title> </head> <body><?php while ($row = mysqli_fetch_array($request)) { var_dump($row); }?> </body></html> there is nothing defining each row... How could I just pull this info and then throw onto the page what I want?
  22. Solved it... After tons of research. <?php $db_host = '###'; $db_user = '###'; $db_pass = '###'; $db_name = '###'; $con = mysqli_connect($db_host, $db_user, $db_pass, $db_name); $request = mysqli_query($con, "SELECT article_content FROM articles"); $result = mysqli_fetch_assoc($request);?><!doctype html><html> <head> <title>Search Protocol</title> </head> <body><?php echo $result['article_content'];?> </body></html><?php mysqli_close($con); ?> Now I added more content to the db, but it only displayes the first row... What is going on?
  23. When I do that I get Resource id #2 which I can safely say is not the content in the table.
×
×
  • Create New...