Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Flex box is good, but should only be needed when you want a behaviour different than the natural flow of elements. Elements will naturally stack themselves vertically and take the full page width with no styling at all, so it would be pointless to use a flex box if your layout just needs stacked elements as is the case for many modern websites. Flex box is useful when you need elements side by side, when you distribute them horizontally. The only downside to flex boxes is that they completely ignore the default box model in order to fit things into their place.
  2. You can use the break-inside property to prevent an element from being split on multiple pages.
  3. I think that it is expected that people have already gone through the HTML and CSS tutorials when reading the How To guides.
  4. It is simple CSS. For this HTML: <div class="like-a-span">...</div> Your CSS would look like this: .like-a-span { display: inline; } This <div> now behaves like a span.
  5. You can use CSS to make the <div> elements behave as inline elements. Being an inline element, <span> is not permitted to contain bock elements such as <div>, so the best option is to use a <div> and use CSS to make it behave like a <span>.
  6. The <option> element does not have a :checked state, only checkboxes and radio buttons do. Furthermore, <option> elements cannot be styled.
  7. The second argument of the Object.create() method contains property definitions which follow a specific format. In your code, the definition of getFoo is saying that its value is a function and that it is enumerable. You can see all of the different features that a definition can have here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties#Parameters If you want your code to behave as you predicted, just drop the Object.create() method and assign the object directly: var jsonLinkObj = { getFoo: { value: function() { return this.foo = 1; }, enumerable: false } }; The purpose of Object.create() is mainly for copying existing objects, if you are just creating a new one you probably don't need it.
  8. Iframes pose their own problems, one of the biggest ones being that the pages in the iframe don't have their URL shown in the address bar, which means that people (and search engines) cannot link back to them.
  9. AJAX won't work if you run the code from a file on your desktop due to security restrictions from the browser.
  10. Probably the easiest and best solution is to install XAMPP or similar server software on your computer. It is very easy to install and there are many more uses for it than just making AJAX requests work. It is default in all browsers today to prevent AJAX requests from local HTML and Javascript files because it could be used by malicious entities to gather information about your computer. There probably is a way to configure the security settings for this but I'd have to search on Google to find out, which is probably something you already know how to do. For Firefox, you probably will find it by typing "about:config" in the address bar which lets you search through thousands of configuration options. I would advise against Javascript includes for a few reasons: Search engines will certainly rank your page lower. Users who have Javascript disabled or browser extensions that strip out Javascript can't see your page properly. The page takes longer to load than if the content were included on the page using a server-side language, this is especially noticeable when viewing the page on mobile connections. If you decide to install a server for testing, I'd also recommend learning a server-side language and using that to include the content instead. It's overall a better experience for the user, the search engines and, in the long term, the people building the website.
  11. Ingolme

    Quiz Platform

    How exactly are these formulas represented?
  12. For what purpose? CSS can be used to render tabs, spaces and line breaks if necessary, see white-space. The existence of the <br> tag already creates enough bad habits in amateur developers, it is better not to create more tags like that one.
  13. Why do you need a loop? Is this a homework question?
  14. That's one way to do it. It'll take even more work to get the arrow to cross over two or more variables. Possible, sure, but not easy. It's not a feature built into the language was what I was getting at. It certainly would be nice if more browsers supported MathML.
  15. I use MDN for HTML and CSS. W3Schools is good for learning. Their primary job is to teach the basics and they do a pretty good job making things easy to understand. It is not complete as a reference, but that's not the focus. As for W3Schools not being kept up to date, I have seen evidence that it is getting updated pretty frequently. It is pretty often that new forum members mention pages on the site that I was not aware existed.
  16. Most likely browsers have this limit to save memory and processing when rendering tables. The table rendering algorithm is pretty slow. Perhaps you should consider a different method to represent the family trees. In fact the tree structure of HTML is ideal for representing tree-like structures. First create the family tree structure using lists in HTML, then use CSS to style them however needed. <ul> <li><span>Item 1</span> <ul> <li><span>Item 1.1</span> <ul> <li><span>Item 1.1.1</span> <ul> <li><span>Item 1.1.1.1</span> <ul> ... </ul> </li> <li><span>Item 1.1.1.2</span> <ul> ... </ul> </li> </ul> </li> <li><span>Item 1.1.2</span> <ul> <li><span>Item 1.1.2.1</span> <ul> ... </ul> </li> <li><span>Item 1.1.2.2</span> <ul> ... </ul> </li> </ul> </li> </ul> </li> <li><span>Item 1.2</span> <ul> <li><span>Item 1.2.1</span> <ul> <li><span>Item 1.2.1.1</span> <ul> ... </ul> </li> <li><span>Item 1.2.1.2</span> <ul> ... </ul> </li> </ul> </li> <li><span>Item 1.2.2</span> <ul> <li><span>Item 1.2.2.1</span> <ul> ... </ul> </li> <li><span>Item 1.2.2.2</span> <ul> ... </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> For the CSS, a flex box will work ul { display: flex; whitespace: nowrap; margin: 0; padding: 0; } li { display: inline-block; flex: 0 0 auto; text-align: center; margin: 0; padding: 0; } li span { display: inline-block; border: 1px solid #AAA; margin: 4px; } This is very basic styling, but there is barely a limit to what you can do with CSS.
  17. There is no way to do that in HTML or CSS.
  18. In math it is normal to add "diacritics" of sorts to variables to indicate what type of information it contains, some examples can be found in this page: https://en.wikipedia.org/wiki/List_of_mathematical_symbols#Letter-based_symbols
  19. Which programming language are you using?
  20. Does the file "azonix-webfont.woff" exist in the same directory as the HTML file? You can check the network tab in your browser's developer tools to see if the font failed to load. Most browsers will display the developer tools when you press the F12 key on your keyboard.
  21. Most sites that deal with math generate images with LaTeX or some similar software and put those on the page. There is an XML-based language called MathML which can render any mathematical symbols but it is only supported by Firefox (https://developer.mozilla.org/en-US/docs/Web/MathML), other browsers haven't caught up yet.
  22. Without seeing your HTML I can't give a specific solution. I would expect the tables to automatically keep things in line. You can use rowspan to make one cell take up multiple rows.
  23. Do you know any CSS? There are several ways to do it in CSS. Either with a flexbox, floated elements or inline blocks.
  24. I'd have to check the references again, but I don't think that SQL has a concatenation operator, "+" is for addition. MySQL uses the CONCAT() function to concatenate strings.
  25. Ingolme

    hrugved

    Items that have a float property set to left or right behave as blocks. Personally I'd have explicitly put the "display: block" in the CSS if I had written the code.
×
×
  • Create New...