We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Copy/paste HTML, HTML DOM, CSS or javascript codes from website itself?

Home Forums Programming Copy/paste HTML, HTML DOM, CSS or javascript codes from website itself?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #80677
    c4cc
    Participant

    I’m trying to copy this css code< as indicated in red. I want to replicate the same exact font, especially for size, style and color:

    View post on imgur.com

    Source

    Intended font for the intended html element :

    View post on imgur.com

    Font for the element containing the intended element

    Yet when I copy and pasted the intended font into my visual studio code, the final font looked like this

    How do I copy/paste the desired code from into my html element so my element’s font is 100% similar? Of course, its size not intended for h1, h2 tags

    • This topic was modified 1 month ago by c4cc.
    • This topic was modified 1 month ago by c4cc.
    • This topic was modified 1 month ago by c4cc.
    #80699

    Hi,

    you could probably use the load font puzzle https://www.soft8soft.com/docs/manual/en/puzzles/Initialization.html#load_font

    Chief 3D Verger | LinkedIn | Twitter

    #80701
    c4cc
    Participant

    Thanks for the suggestion, it’s just that I wanna try copying css properties from other webpages without using puzzles.

    While those puzzles are indeed helpful I may need to learn this without puzzles

    • This reply was modified 1 month ago by c4cc.
    #80703
    Pandern
    Customer
    @font-face {
      font-family: 'Founders Grotesk Regular';
      font-weight: 400;
      src: url('//forum-font.cdn.bubble.io/f1591661753437x401230189466371460/founders-grotesk-web-regular.woff');
    }
    
    html {
        font-family: 'Founders Grotesk Regular', Helvetica, Arial, sans-serif !important;
        font-size: 18px;
        word-spacing: 2px;
        line-height: 1.3;
    }

    I guess you forgot to copy/paste the source of the font, like they have in their css?

    #80704
    c4cc
    Participant

    Thanks. I’ll look this up

    #80718
    c4cc
    Participant

    My css

    View post on imgur.com

    I tried, looks like this:

    View post on imgur.com

    Besides color and font size, not really the same style as this:

    View post on imgur.com

    #80721
    Pandern
    Customer

    You still need to source the font. It displays helvetica because Founders grotesk is not found.

    You can download the font by clicking on this link:
    http://forum-font.cdn.bubble.io/f1591661753437x401230189466371460/founders-grotesk-web-regular.woff

    Put it in the base folder of your project and source it like this:

    @font-face {
      font-family: 'Founders Grotesk Regular';
      font-weight: 400;
      src: url('founders-grotesk-web-regular.woff');
    }

    you are missing quite a bit of the styling from that site. And h1 and h2 in your css might override any styling you put in .help.

    Add this to your .help

    padding: 1em 11px .25em 11px;
    line-height: 1.3;
    word-spacing: 2px;
    word-wrap: break-word;

    Try also to put your text inside a <p> tag. Like this:

    <div class="help">
      <p>
         <h1>Player Controls.....
       </p>
    </div>
    #80723
    c4cc
    Participant

    I tried
    Downloaded font in base folder:

    View post on imgur.com

    View post on imgur.com

    Text inside p tags

    View post on imgur.com

    Where there’s improvement, the font thickness is not the same as that of the source’s?

    View post on imgur.com

    desired font style and thickness:

    View post on imgur.com

    • This reply was modified 1 month ago by c4cc.
    • This reply was modified 1 month ago by c4cc.
    #80732
    Pandern
    Customer

    Okay, well, at least the font is correct now.

    And the text looks the same to me, except for the <h1> and <h2>, which by design are larger and thicker.

    Use only one <p> for wrapping the whole text, not each line. The <p> stands for paragraph and has system styling from the browser. Thats how it is used in the bubble site.

    Instead of trying to learn CSS by copying from a complex web site, you should maybe learn the basics of webdesign. Then you will be able to copy style from websites more easily.

    This one is a good start: https://www.freecodecamp.org/learn/2022/responsive-web-design/

    #80740
    c4cc
    Participant

    Where there’s improvement, the font thickness is not the same as that of the source’s?

    Sorry, I meant to say, “While there’s improvement… ” Sorry for the typo. I was in a rush and I didn’t see it

    *facepalm

    Thanks for your advice again, Pandern, I appreciate it.

    • This reply was modified 1 month ago by c4cc.
    #80835
    c4cc
    Participant

    How come this element has no font-family name in?

    View post on imgur.com

    Source

    Thought normally font-family name is required

    View post on imgur.com

    Source

    #80838
    Pandern
    Customer

    It does… sort of. It inherits it from html

    font is a shorthand that can set all the different properties of an element’s font:

    font: 300 15px / 1.73 'Open Sans', sans-serif;

    https://developer.mozilla.org/en-US/docs/Web/CSS/font

    • This reply was modified 4 weeks ago by Pandern.
    • This reply was modified 4 weeks ago by Pandern.
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.