Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS :after content in head tag

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #45449
    Masserra
    Participant

    Hi guys!

    Can someone help me figure this out? I have a friend that wants to change his font to fonts from google webfonts, but in a Cargo Collective website that is not upgraded to professional, so he cant change anything in the html.

    So I thought of CSS :after content to put the necessary javascript code in the document head, is that possible? Because I remember a post from css-tricks a while ago that did a complete webpage only using CSS and no html except of course the css tag itself. I tried to find the post but I couldn’t. Does someone know how to find it? And has anyone tried this thing I’m trying to do?

    Thanks for the help! ;)

    #138330
    Paulie_D
    Member

    >I thought of CSS :after content to put the necessary javascript code in the document head, is that possible

    No because the :after selector only works on html elements and can’t contain HTML

    >Because I remember a post from css-tricks a while ago that did a complete webpage only using CSS and no html except of course the css tag itself.

    No such thing. A page is written in HTML and styled with CSS.

    Google Fonts are supported in the upgraded version though : http://support.cargocollective.com/customer/portal/articles/670986-webfonts-and-custom-typography

    >Google Web Fonts

    >Free, hosted service; you can add Google web fonts into your site simply by going to the website, choosing the fonts you’re looking for, and copying the generated stylesheet link into your Custom HTML.

    Frankly $66 p.a. seems reasonable for the extra.

    #138359
    Masserra
    Participant

    Haha! Sorry, I know that css is made for styling, but I thought there could be a way to do that since I remembered someone having published here years ago an article of building a page with css only, no html. By the way, I found it ([https://css-tricks.com/using-css-without-html/](https://css-tricks.com/using-css-without-html/ “CSS without HTML”)) and its no more than a supposition! Hehe! I didn’t remember… :)

    But yeah… thats true… even if you could use Hexadecimal entities it would be percepted by the browser as text and not html… and another thing, wasn’t I able to use content with the head tag? Isn’t it a html tag like any other?

    Thanks!

    #138361
    Masserra
    Participant

    *forgot the “why”… “why wasn’t I able to use content with the head tag? Isn’t it a html tag like any other?”

    #138362
    Paulie_D
    Member

    `` is HTML code but it’s not a element that displays on the page

    >The head element represents a collection of metadata for the Document.

    http://html5doctor.com/element-index/#head

    #138364
    Masserra
    Participant

    Right! Css is for styling, so only visible elements can be styled… of course… thanks! ;)

    #138365
    Paulie_D
    Member

    >only visible elements can be styled

    Not exactly….elements inside the `` will be visible unless told not to (the HTML element is a special case) but you are trying to add actual **HTML code** with a pseudo element and that’s not possible.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.