Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 37
  1. #11
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,144
    Plugin Contributions
    11

    Default Re: Adding Text Into The Header

    I do tend to avoid em in favor of px in most cases involving margin but that's just me. I tend to use em more where it might not make a difference if the font changed. Like padding for instance. Mixing em and px in a document can do crazy things if an element is added that changes the relative font size.

  2. #12
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: Adding Text Into The Header

    Quote Originally Posted by dbltoe View Post
    Actually, since the text is in a PHP echo, you would use \n instead of the HTML <br />. You could also split the lines in the echo by using
    Code:
    <div class="logoText"><?php echo 'This is my text1' . PHP_EOL . 'This is my text2'; ?></div>
    You can see why the \n is generally used. Less confusion or chances for mistakes.
    Just for appearances, I'd add a margin-right:20px; to the stylesheet to make it
    Code:
    .logoText {float:right;margin-right:20pc;}
    This gets the text more in line with that below it.
    I do find it interesting that the text disappears in mobile view.

    Most of this was on hold while getting a snack. Too slow as usual.
    This ..
    <div class="logoText"><?php echo 'This is my text1' . PHP_EOL . 'This is my text2'; ?></div>
    In the php file still keeps it on 1 line ??? Where is the /n ??

  3. #13
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: Adding Text Into The Header

    Using </n> Instead Of </br> again keeps it all on 1 line LOL ???

  4. #14
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: Adding Text Into The Header

    If I use the </br> it works but then I end up with the icons below being thrown out ...

    Name:  Capture.JPG
Views: 50
Size:  12.0 KB

  5. #15
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,144
    Plugin Contributions
    11

    Default Re: Adding Text Into The Header

    taking another look
    Last edited by dbltoe; 5 Jul 2016 at 07:23 PM. Reason: wrong text

  6. #16
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: Adding Text Into The Header

    Quote Originally Posted by dbltoe View Post
    taking another look
    Sorry mate I`ve changed it again. I used your suggestion and it keeps it on 1 line still

  7. #17
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,144
    Plugin Contributions
    11

    Default Re: Adding Text Into The Header

    gotta client emergency Google add carriage return to php echo

  8. #18
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: Adding Text Into The Header

    Quote Originally Posted by dbltoe View Post
    gotta client emergency Google add carriage return to php echo
    I'm looking now but its blowing me away mate, I would appreciate your help when you are free mate. I do appreciate your assistance.

  9. #19
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Adding Text Into The Header

    If memory serves even half way correctly and you want to use the \n character instead, it should be added within double quotes instead of the single quoted string currently used.
    Code:
    echo 'This is text 1' . "\n" . 'text 2';
    Or possibly use three echo lines, the first your first text, the second PHP_EOL, and the third your text 2...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #20
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,144
    Plugin Contributions
    11

    Default Re: Adding Text Into The Header

    The reason I was taking another look is that I wanted to make sure this wasn't going to break with a PHP upgrade. Let's try
    Code:
    <div class="logoText"><?php echo nl2br("'This is my text1.\n\rThis is my text2."); ?></div>
    If there's too much spacing between the lines, remove the \r to see if that helps. The example shown should result in
    Code:
    This is my text1.
    
    This is my text2.
    Without the \r the result should be
    Code:
    This is my text1.
    This is my text2.

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. cannot process the adding of the item into the shopping cart
    By wufoxuan in forum General Questions
    Replies: 1
    Last Post: 7 May 2010, 05:26 AM
  2. Adding Text to left side header
    By RobertG in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Apr 2010, 09:18 PM
  3. Adding text in header
    By treasureshaven in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Sep 2009, 04:59 PM
  4. Replies: 0
    Last Post: 7 Jan 2009, 05:49 PM
  5. How to get the header search bar into the nav bread crumb?
    By Mister-Norway in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 17 Aug 2008, 01:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR