Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by Funce

  1. You won't be able to get it with inline styling but you can create a custom class that will do so for you.

    @media print {
        .pagebreak {
            clear: both;
          	min-height: 1px;
            page-break-after: always;
        }
    }

    If you then add the pagebreak class to a <div> like class (not <span>) you'll then get a pagebreak immediately after the content its attached to. (this may be empty if desired as shown below)

    <div class="pagebreak"></div>

     

  2. 2 hours ago, vitalnet said:

    I'm disappointed not to hear anything back. If I need to clarify my question, please let me know. I thought it was a clearly expressed and helpful post. But beggars cannot be choosers. 😊 In any case, thanks for the incredibly great w3schools website. I have learned a lot through the excellent tutorials and references. And maybe I will eventually hear back.

    Apologies, I must've seen this on my phone and so it dismisses it from my unreads so I didn't see it when I got to my PC.

     

    A tooltip to me is a hint given when hovered or otherwise interacted with. Be it via the subject itself or an info icon. The method in which the information is delivered should be somewhat unobtrusive, but past that anything goes for a tooltip. The built in tooltip features for browsers may not be consistent enough for some.

  3. Try to use the code block feature of the forum to format it nicely, colour it, and to avoid it getting eaten by the formatter. If you could edit your previous post.

    XcQfW3F.png

     

    Adding an additional dropdown shouldn't be too bad.  Just add another dropdown set after your previous <div class="dropdown"> and it'll also be in the navbar.

    <div class="dropdown">
      <button class="dropbtn">New</button>
      <div class="dropdown-content">
        <div class="row">
          <div class="column">
            <h3>Another 1</h3>
            <a href="#">Link 1</a>
            <a href="#">Link 2</a>
            <a href="#">Link 3</a>
          </div>
          <div class="column">
            <h3>Another 2</h3>
            <a href="#">Link 1</a>
            <a href="#">Link 2</a>
            <a href="#">Link 3</a>
          </div>
          <div class="column">
            <h3>Another 3</h3>
            <a href="#">Link 1</a>
            <a href="#">Link 2</a>
            <a href="#">Link 3</a>
          </div>
        </div>
      </div>
    </div>

    Unless you're after a sub-dropdown menu, as in a dropdown inside a dropdown. Then it gets trickier.

    • Like 1
  4. The JavaScript compiler thinks your concatenating a string with a number, not performing addition. Input always returns a string, regardless of the type attribute. You'll need to typecast the price variable to a number by using any of the following.

    • parseInt(price) - If you know its going to be a whole number (which I don't think that's guaranteed). Errors on text.
    • parseFloat(price) - If you know it can be a non-whole number. Errors on text.
    • Number(price) - This assigns integer or float based on the input. NaN on text.

     

    As an aside

    The onchange event fires when the input loses focus while it has a different value.

    In addition to onchange, you could add onkeyup to get an output as you type.

  5. A lot of your tags aren't matching up, its screwing up my auto-styler. I ran your code through the HTML checker, and... well, you should see for yourself.

    From what I could see though, you could benefit from having a look at this tutorial here through.

    https://www.w3schools.com/css/css_positioning.asp

    Using position:relative on your container, and position:absolute with top:0 and right:0 on your sidebar/box should give you something close to what you're after.

  6. That would be because attributes aren't supposed to be surrounded in quotes. Only their values.

    Also, the bgcolor attribute on your body is old, and should be replaced with background-color in your styling/css.

    Try this on for size

    <!DOCTYPE html>
    <html>
      <head>
        <title>HTML page</title>
      </head>
      <body style="color: pink; background-color: black">
        <h1>Testing</h1>
        <h5>Heading 5</h5>
        <p title="Dummy text">
          Lorem Ipsum Dolor Sit Amet.
        </p>
      </body>
    </html>

    May I suggest looking into a code editor? I personally use Visual Studio Code

     

    • Thanks 1
  7. If you want to include files that also include files, you need to use a relative to root path. Otherwise, the context of your files will change. index.php at /myproject/ works fine, because you have /myproject/inc/ps.db_con.php, but when you go into inc/script.myinformation.php the link would instead need to be ps.db_con.php because they're in the same directory.

    Your relative to root path you've suggested above is incorrect, as the HTML style paths only works when you have a server to check the root against. Because this is the server processing, we have no such luxury.

    My solution I use is as follows.

    <?php
    require_once $_SERVER['DOCUMENT_ROOT'] . "/relativeToRoot/path/to/file.php";

    In your case it would be

    <?php
    require_once $_SERVER['DOCUMENT_ROOT'] . "/myproject/inc/ps.db_con.php";

     

    • Like 1
  8. Was there a printing issue with this question? This HTML very shaky. It seems like a trick question.

    Does the validity of the HTML matter in your question?

     

  9. This question is pretty vague, but in terms of technical details, all of this can fall under form handling. Try having a look at the link below.

    PHP Form Handling

    It's just an extra field on any given signup page.  Signup Form Example

    The real tricky bit will be how you then manage to style your profile page layouts corresponding to the choice. Do you import a different stylesheet? Is your styles inserted inline? (not advised) Does your JavaScript do a small AJAX request to find out what styling is used, or do you generate it server-side?

    If you have any other questions, do not hesitate to ask.

  10. Font-size: inherit, only works if you've defined a font size earlier in the document. Because you don't, it doesn't do any different from the default, which is 13.3333px (on Chrome)

    You'll need to set the font-size on your <body> tag for inherit to work. Set it to 16 to start with.

×
×
  • Create New...