Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Background colour for text only

Background colour for text only

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 65 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davidpap
    wrote on last edited by
    #1

    Hi! I wonder how I can make a background colour that only covers the text that is written, and not the full text box? Just like on your front-page, where the headline text got a white background behind the text only "Lay Theme, A WordPress Theme
    for Creative Websites". So its like a highlight of the text only, not the full text box.

    1 Reply Last reply
    0
    • reinterpretR Offline
      reinterpretR Offline
      reinterpret
      wrote on last edited by
      #2

      CSS with display:table should do it.

      Like:
      .yourclass{Display:table; background-Color:#0000ff}

      You can also do it inline with for example <span style= “ Display:table; background-Color:#0000ff;“>your text</span>

      1 Reply Last reply
      0
      • reinterpretR Offline
        reinterpretR Offline
        reinterpret
        wrote on last edited by
        #3

        But with span you can also give it a background Color without table

        1 Reply Last reply
        0
        • reinterpretR Offline
          reinterpretR Offline
          reinterpret
          wrote on last edited by
          #4

          Or to Header class like H1, H2 …

          1 Reply Last reply
          0
          • arminunruhA Offline
            arminunruhA Offline
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            Yeah, I used display inline and a background color.

            Right-click your text element in the Gridder and choose Set HTML Class and ID.

            As HTML class add:

            mybg

            Enter this css in "lay options" -> "custom css & html" -> "custom css"

            .mybg p{
            display: inline;
            background-color: green;
            }
            

            Make sure to turn off the background color that you set in the gridder for the text box as this will not work with that one.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            I also code custom websites or custom Lay features.
            💿 Email me here: 💿
            info@laytheme.com

            Before you post:
            1. When using a WordPress Cache plugin, disable it or clear your cache.
            2. Update Lay Theme and all Lay Theme Addons
            3. Disable all Plugins
            4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

            This often solves issues you might run into

            When you post:
            1. Post a link to where the problem is
            2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
            3. If the problem is difficult to explain, post screenshots / link to a video to explain it
            Online Users
            S
            spale176
            E
            ersc_
            Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
            laytheme.com
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search