Page 1 of 2

How do I add 20px to the top of the header with CSS?

Posted: Mon Mar 16, 2015 9:49 pm
by Ellen Schlechter

I want to add to the top of the header so the status bar doesn't overlap with it. How should I add 20px to the top with CSS?


How do I add 20px to the top of the header with CSS?

Posted: Tue Mar 17, 2015 5:31 am
by Yurii Orishchuk

Hi Ellen,

You try following:

  1. Add new CSS asset.

  2. Use following CSS code for it:

    pre

    [data-role="header"]{
    margin-top: 20px;
    }

    /pre

    Regards.


How do I add 20px to the top of the header with CSS?

Posted: Tue Mar 17, 2015 4:03 pm
by Ellen Schlechter

That code just shifted the header down 20px. That didn't work because the page contents is visible when you scroll. Would it be possible to add a color to it for example #FEFEFE so that it isn't transparent?


How do I add 20px to the top of the header with CSS?

Posted: Wed Mar 18, 2015 2:22 am
by Yurii Orishchuk

Hi Ellen,

Yes, you can add some absolute bar do it with following way:

  1. Open your app start page.

  2. Add "Page load" event handler with action "Run javascript".

  3. Populate it with following JS code:

    pre

    var barHTML = '';

    var barElement = jQuery(barHTML);

    jQuery("body").append(barElement);

    /pre

    Regards.


How do I add 20px to the top of the header with CSS?

Posted: Wed Mar 18, 2015 2:27 am
by Ellen Schlechter

That didn't do anything.


How do I add 20px to the top of the header with CSS?

Posted: Wed Mar 18, 2015 2:33 am
by Yurii Orishchuk

Sorry, code should be:

precode

var barHTML = '<div style="position: fixed; top: 0; left: 0; right: 0; height: 20px; background: #eee; z-index: 1000"><>';

var barElement = jQuery(barHTML);

jQuery("body")&#46;append(barElement);

/code/pre

Regards.


How do I add 20px to the top of the header with CSS?

Posted: Wed Mar 18, 2015 2:37 am
by Ellen Schlechter

Thanks. I used that along with the first CSS you provided and it worked!


How do I add 20px to the top of the header with CSS?

Posted: Wed Mar 18, 2015 11:09 pm
by Ellen Schlechter

I spoke too soon. With both included, I get two 20px places. With only the JS, it goes on top and overlaps the header. With only the CSS, page contents can be seen. Any other suggestions??


How do I add 20px to the top of the header with CSS?

Posted: Fri Mar 20, 2015 4:40 am
by Yurii Orishchuk

Hi Ellen,

Your problem is not clear for this time..

Show us some screen shots to clarify it.

Regards.


How do I add 20px to the top of the header with CSS?

Posted: Sat Mar 21, 2015 12:08 am
by Ellen Schlechter

Image

Here is the picture. Notice that there is something weird with the status bar.