Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. You can give a class name to the <col> elements, but I'm not sure how well CSS is supported on them. You can also give a class name to each cell of a column: <tr> <th class="instinct">Instinct</th> <th class="synonyms">Synonyms</th> <th class="utility">Utility</th> <th class="chap">Chap</th> </tr> Then use CSS to give the widths: .instinct { width: 110px; } .synonyms { width: 150px; } .chap { width: 40px; }
  2. If the amount of data is small enough that downloading it all does not cause a noticeable reduction in load time, that probably means it fits on one page of paginated data. If you don't like to see pagination buttons on your page, you can program it not to display the buttons if there's only one page.
  3. The website you referenced probably uses a Javascript library called Masonry. You can downloaded it from here: http://masonry.desandro.com/
  4. You don't have to modify the original script, you just have to write some Javascript to change the page after the other script has finished running.
  5. Well, I wouldn't say that's grounds to tell a beginner they're doing it wrong. All we have right now to determine the semantic meaning of any element is vague descriptions by the W3C and explanations by some of the top web developers. Mozilla is part of the W3C, so I wouldn't take their word lightly.
  6. If you make the shopping cart a background image then you can use a combination of line-height, text-align and text-indent to put it into place. The code would be something like this: .cart { background: url(/images/shoppingcart.png) no-repeat center; background-size: cover; width: 54px; height: 40px; line-height: 40px; text-align: center; text-indent: 6px; } You'll have to tweak the values to get it in the right place. It's not a good idea to have a <div> inside an <a> element.
  7. This looks like it's out of place due to using absolute positioning. I'm not exactly sure where it's meant to be, but if you want it next to the cart you can make it a span, or you can display it as an inline-block.
  8. I think the best solution is to have a PHP pagination system which is overridden by AJAX. That means that at no point do you download all the data at once which is a cause of slow page loading.
  9. MySQLi uses fetch_all() while PDO uses fetchAll(). Personally, I prefer PDO.
  10. I checked the site and it looks functional to me. I can't know which divs are misplaced unless you tell me what it's actually supposed to look like. I recommend resizing your images because they take forever to load. You're loading images thousands of pixels in length to only display it in an area of a few hundred pixels across.
  11. You can use Javascript to look through each element of the dropdown and modify its value. var selectObject = [reference to dropdown element here]; var options = selectObject.getElementsByTagName("option"); for(var i = 0; i < options.length, i++) { options[i].value = options[i].text; } Of course, doing this will mean you lose the actual ID of the car. There are other more complicated solutions for if you need both the ID and the name.
  12. That's one valid way to use the <nav>, of course, but it has its drawbacks, for example you can't style the elements of the second list differently than the ones in the first list. You also lose the ability to have a hierarchy of links. You cannot compare this to the usage of tables because the navigation of the page continues to be a list of links and that has not changed with the introduction of the <nav> element. Here are a few reputable sources that endorse the usage of lists for navigation: http://html5doctor.com/nav-element/ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav https://css-tricks.com/navigation-in-lists-to-be-or-not-to-be/ http://stackoverflow.com/questions/5544885/should-i-use-uls-and-lis-inside-my-navs Where are your sources?
  13. If there's Javascript running on the page then there's at least one program, since Javascript is, by all definition, a programming language. I have built applications in Javascript that could easily be rewritten in Java or C++. Why would the same set of instructions be considered a program in one programming language but not another? The line between program and not-program blurs when the Javascript is just used for minor alterations in behavior for some elements on the page.
  14. What you write in Javascript is a program. It's a sequence of instructions that perform a task.
  15. It depends on what rules you want to use to convert the string into an array. There's str_split() if you want to break the string into equally sized array pieces, preg_split() works like explode() except that it uses a regular expression as the delimiter. If you tell us what exactly you're trying to do with the string then we can be more specific with how to turn it into an array.
  16. I see nothing in that paragraph explicitly stating that you can't have more than just <a> elements inside a <nav>. It even refers to the <nav> as a section of the page. In other words, a perfectly good use for the nav could be this structure: <nav> <h2>Area 1</h2> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> <h2>Area 2</h2> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </nav> Please do not criticize code from beginners, especially if it isn't clear that they are wrong. I find that most of your posts are actually discouraging beginners from pursuing web development, there are ways to help people learn what's wrong in their code without trying to emotionally scar them.
  17. The <nav> element is used to indicate a region on the page used for navigation. It is actually semantically correct and preferable to indicate that you have a list of links inside your navigation area, hence a <ul> inside the <nav> region. Is there something in the W3C specifications that specifies that a list inside a navigation region is incorrect? The W3C can't make a comprehensive list of every possible situation that might occur by using semantic elements in conjunction with each other. Unlike with language syntax, there is not specific strict set of rules governing the semantic web because it's all about giving meaning to the content, which is subject to interpretation.
  18. The <font> tag has been deprecated since 1999. You're not allowed to use it anymore.
  19. You need two things: 1. The specification which indicates which compression algorithm 0 refers to 2. A program that will run that algorithm on the string. Since the string probably contains some non-printable characters, what you've posted on the forum probably won't work, you need to get the specific bytes from the file and pass them through the decompression algorithm.
  20. It's not really deprecated because it was never part of the standard to begin with.
  21. The most comprehensive guide to PHP is on the PHP website itself. It looks like you want to learn about strings. Here's the manual page for strings: http://php.net/manual/en/language.types.string.php I would not recommend putting variables in SQL strings because it's a big security vulnerability. It's best to use prepared statements which is something you should learn about once you've mastered the basics of PHP.
  22. What do you see that indicates that the encoding is not correct?
  23. Looks like there's a $count++ missing at the end of the loop.
  24. That's a syntax error, you should be able to find it. Look for any unclosed parentheses or braces or a line missing a semi-colon. I don't write code to be copied and pasted, but as a learning experience.
×
×
  • Create New...