Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. That site is only using one background image. It's using the box-shadow for the border on the bottom and right.
  2. Ingolme

    margin: auto auto?

    There's a method involving absolute positioning, and the other thing is using percentage heights and margins. Both methods require the container to have a set height. Using absolute positioning. The drawback is that if the window gets smaller than 800x600 then the content is outside the viewable area and impossible to get to. I guess setting a min-width and min-height to the body would fix that. html, body {margin: 0;height: 100%;}#box { /* Top left corner in the middle of the screen */ top: 50%; left: 50%; /* Set size */ width: 800px; height: 600px; /* Move the box halfway left and halfway up */ ; margin-top: -300px;} Using percentages Decide a percentage height for your box, divide the remaining percentage by 2 to determine the offset from the top. html, body { margin: 0; height: 100%;}#box { width: 960px; /* Use any width you want */ margin: 0 auto; margin-top: 10%; height: 80%;}
  3. What's a "status box?" Javascript is always "connected" to HTML. They work together.
  4. What is it supposed to do and what is it actually doing? Describe the problem in detail. "Not working" could mean anything. I tried in Internet Explorer and it works exactly the same as in other browsers.
  5. Just make two columns, and put the rest of the boxes inside: <div id="columnA"> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div></div><div id="columnB"> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div></div> #columnA { width: 50%; float: left; padding: 1px 0; /* Prevent collapsing margins */}#columnB { margin-left: 50%; padding: 1px 0; /* Prevent collapsing margins */}.box { border: 1px solid red; border-radius: 10px; -moz-border-radius: 10px; margin: 5px 10px;}
  6. Javascript isn't capable of reading files from the client's computer, it's a security feature.
  7. It can't be done. Browsers are a closed environment. If your target machine can interpret HTML 5, then video tag support is supposed to be there.
  8. Browser detection is very unreliable. Look at the userAgent string to see what Opera is giving it. Why do you want to know what browser the user has?
  9. At the moment Internet Explorer's developer tools allow you to view a site with versions all the way back to 7. Just press F12 and the developer toolbar will show up.
  10. The <marquee> element isn't valid HTML, but besides that, you can put pretty much anything you want inside the <canvas> element and it should work without trouble.
  11. Goodness, you should try to understand what things mean rather than waiting for other people to tell you. The PHP manual page for glob() would explain it, of course.
  12. This is going to fail because c27 is wrapped in aspostrophes when it shouldn't be: $sql2 = "select * from 'c27'"; About this error, we have a thread dedicated to it: http://w3schools.invisionzone.com/index.php?showtopic=44106 It means MySQL encountered an error. Using SELECT on a table that doesn't exist probably would make mysql send an error message. If you want to know if a table exists, do the following query: SHOW TABLES LIKE c27 If the you can fetch any rows from that query then the table exists, otherwise the table doesn't exist.
  13. Maybe glob() isn't returning what you think it is. Use var_dump() to see what glob is returning. $x = glob("..."); var_dump($x);
  14. I'd structure it this way: <dl> <dt>Vegetables</dt> <dd> <dl> <dt>Corn</dt> <dd>On the cob</dd> <dd>Cream</dd> </dl> </dd></dl> Don't use <u> or <em> to style things. Use class names and selectors to target elements and style them with CSS.
  15. The innerHTML is probably storing the empty <p> element as <p/>. Don E's method is the most reliable way to remove empty paragraphs.
  16. I can't determine what the problem or solution is because both sites are displaying properly for me.
  17. Ingolme

    Website logging

    Logging PHP and SQL errors is probably all you're going to need.
  18. console.log doesn't return a value. Forget alert(), console.log will show the value in Firebug's console.
  19. Yes, that's pretty much what most people do. jQuery has that all done internally, though, so if you're using jQuery you don't need to worry about cross-browser compatibility. I'd change the last condition to: element["on" + event] = funct;
  20. Internet Explorer 8 and below use attachEvent() instead, which works just as well.
  21. Yes, you have to declare the function in that way if it belongs to an object. I'd recommend useing addEventListener rather than .onclick or .onload if you want to avoid overwriting events or having them overwritten by other scripts.
  22. If the response is showing the variable's value then the problem is how you're managing the response. In the success callback, see what's in response: I assume jQuery puts the text in the response variable. success: function(response) { console.log(response); }
  23. It depends on what the value is going to be used for. If it's going to be used on a page use htmlspecialchars() to prevent people from messing up the HTML, if it's going to be used in a database you can use prepared statements or pass the value through mysqli_real_escape_string().
  24. Your page might be running in quirks mode. <!DOCTYPE> is supposed to be fully uppercase.
×
×
  • Create New...