Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Setting a max-width and margin is actually the normal way to do it. You don't need to set the width to 100% though, since they already do that naturally.
  2. The tutorial does say that the function is invoked using the ( ) operator.
  3. Ingolme

    updatetext

    Don't put the field name in quotes, that's telling it to use the field's name as a string. Use backticks for field names. `cnt_email`
  4. This isn't a table, it's merely using the table layout algorithm on elements that aren't tables. <div class="grid"> <div class="column"> Column 1 </div> <div class="column"> Column 2 </div> </div> .grid { display: table-row; border-collapse: collapse; } .grid .column { display: table-cell; background: #F0F0F0; } /* Phones are too small to display things side-by-side */ @media screen and (max-width:640px) { .grid, .grid .column { display: block; } }
  5. You could use a sessionStorage variable to only open the popup once per session. I'd have to look into this in more detail later.
  6. There's either flexbox or setting the display to table-cell wrapped in an element with a table-row display. I don't think either of these techniques are shown in the tutorials. Personally I'd go with the table-cell option and remove the cell display with media queries on mobile devices.
  7. Ingolme

    updatetext

    If you're using MySQL, it has a replace() function https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_replace It would look something like this: UPDATE `table` SET `field` = REPLACE(`field`, 'oldname.com', 'newcompanyname.com') Do not copy and paste that code because you might ruin your whole table. I haven't tested it to see if it does exactly what I expect it to, so you should run it on a test table and tweak the code if necessary. If you're not using MySQL then you'll need to loop through all the records, process them in a server-side language and then update them.
  8. I've been pretty busy so I've just been answering short questions that don't need a lot of research. I think you probably intended to do an assignment here instead of a comparison. if(typeof navtype != "undefined" && navtype !== null) { performance.navigation.type === 1; } I actually have never worked with the performance.navigation object, so I don't even know what it's for. I'll look it up once I have the time.
  9. How much experience do you have with CSS?
  10. That's a very broad question. It depends on how you want to classify them. You could classify them by hardware, by operating system, by server software or countless other features. By hardware there's a limitless amount of server configurations given the amount of memory, storage and processing. You can also distinguish between physical servers, virtual servers or server clusters. By operating system the two main categories would be Windows and Linux. Under Windows there are several versions, Linux has a whole lot of different distributions. The two biggest server software packages are Apache and IIS. IIS usually only runs on Windows servers.
  11. You can put anything you want in the snackbar. I'm not sure what your files you're referring to, all the code is right there in the example and not being loaded from an external file. Learn how the code works so that you can build it on your own.
  12. Ingolme

    Page Gradient Text

    CSS can't put gradients on text. Perhaps you can make your gradients more subtle so that the text isn't hard to read on it.
  13. Set the bottom to zero, left to zero and width to 100%. For the animation frames, instead of going from 0 to 30px, make it go from -30px to 0. I modified the example: https://www.w3schools.com/code/tryit.asp?filename=FKZOXM2O3JB1
  14. Usually the discrepancy between mobile browsers and a resized viewport on desktop comes from not having a meta viewport tag. If you open Google Chrome's developer tools, it has a really accurate mobile emulator that takes the viewport tag into account and it emulates a touch screen.
  15. I'm not familiar with the term "snackbar" in the context of web development. Could you describe what it is?
  16. 1. Success and complete are just a jQuery thing, but if you're using jQuery that is correct. Those functions get called once the request is complete. In the case of plain AJAX, the readystatechange event handler is what's executed when the request is done. 2. The HTML must already be loaded if Javascript should interact with it, but that usually is the case since AJAX is usually called after the page has finished loading. Note that if you change the DOM using innerHTML or jQuery's html() method any references to HTML elements from that page region that were stored in variables will no longer work even if they have the same ID or class name as before. You will need to load them again using a jQuery selector or DOM methods such as getElementById(). 3. That's correct. 4. AJAX doesn't import Javascript variables. It can return data that may be interpreted as a Javascript object. jQuery will automatically parse JSON for you into an object, but that object is only accessible as a parameter in the complete() method of the AJAX request.
  17. CSS frameworks sometimes use the !important attribute on things that they don't want modified by the people using the frameworks. I can't say for certain why they decided to do that with W3.CSS.
  18. I don't know anything about tumblr. Look for an HTML element that is wrapping around your text and apply the margin and max-width to it.
  19. You need CSS if you want to properly make a web page. To center a block of text you can set the max-width of the container and give it a left and right margin of auto. HTML <div class="text"> <p>Lorem ipsum dolor sit amet</p> </div> CSS .text { max-width: 600px; margin: 0 auto; }
  20. CSS does not have predecessor or ancestor selectors because the CSS rendering engine is stateless, it only moves forward and down the DOM tree without having to backtrack. Being stateless means that it is efficient and can render pages really quickly.
  21. Ingolme

    href null link

    You can use HTML 5 with XHTML syntax, it's referred to as "XHTML 5". HTML 5 will not be going anywhere, it's referred to as the "Living Standard". The computer world is always updating, if you don't keep up you end up in technical debt. It's alright if your job isn't web development, but if you do it as a job you have to keep up to date. Phones already have a lot of pixels, but they don't represent websites at their native resolution because text would be way too small to read, instead phones act as if they had fewer pixels so that the text is large enough to be readable on them. It's up to you if you want to keep your sites as they are, but if you have stakes in your websites it would do good to make them mobile-friendly. Never do this. It's merely a piece of code people copied and pasted from other people, generation to generation. Do you know what "javascript:void(0)" means?
  22. Some text editors replace standard quotes ("") with curly quotes (“”) which messes up the code. Check your text editor settings to make sure it's not doing that to your quotation marks. If there isn't a setting for that in your text editor then try looking for another one, there are plenty of free ones out there.
  23. Perhaps your browser cache is still loading the old stylesheet from the phone's memory. Check your browser settings to delete cached files.
  24. Ingolme

    href null link

    The "#" usually links to the top of the page, it's a specific form of the hash part of the URL, which links to certain sections within a page without reloading. People usually use it on links that are controlled by Javascript so that if the Javascript doesn't run the page won't be reloaded. There's no real problem with it, but it is kind of pointless to use the "#" in your link. It comes from a very old practice when Internet Explorer would only listen to click events on <a> elements. Now that click events work on anything, if you don't need a link then use a different element instead, you could put the event handler straight on the <li> element. If you do need a link, then make the href attribute point to a meaningful page. The page you're linking to uses a CSS based menu, so Javascript isn't involved, but the same principles can apply. The :hover pseudo-selector could be placed on a <span> or <div> instead of a link if they wanted to prevent clicking from opening a new page. Using href="" points to the current page, it's a perfectly valid link. If you need to point a link to the current page, that's a reliable way to do it. The website you're linking to has some really old code. XHTML Transitional was intended to help people transition from HTML 3.2 to XHTML without having to rewrite a whole lot of their code back in 1999, but a lot of people just got stuck in the transition and never moved further. People continued using Transitional XHTML because they thought it was easier than following the stricter standards. Even then, XHTML itself has been phased out because the W3C couldn't pull themselves together to finish XHTML 2.0 and WHATWG stepped up to create HTML 5 instead. I would advise that you pay more attention to mobile and tablet devices because the comprise around 60% of web traffic today. If you're still working with XHTML you have a whole lot of catching up to do to create proper websites today.
  25. When it shows you all the code (it's minified CSS). right-click and choose "Save As..." and save the file with a .css extension.
×
×
  • Create New...