Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service name falls below GOV.UK in header when there is whitespace between the two divs #828

Closed
pds2208 opened this issue Jun 25, 2018 · 2 comments · Fixed by #884
Closed
Assignees
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation)

Comments

@pds2208
Copy link

pds2208 commented Jun 25, 2018

ISSUE:

The example at: https://design-system.service.gov.uk/components/header/ for the service name example will put the service name underneath the GOV.UK header instead of alongside it. This is because the header code relies on a closing and opening div being on the same line.

EXPECTED BEHAVIOUR:
The header should work correctly regardless of whether a div is on the same line or not.

REPRODUCE:
Open your test page here in Chrome: https://design-system.service.gov.uk/components/header/with-service-name/index.html

Inspect element.
To the left of: govuk-header__container govuk-width-container on the three dots right click and 'edit as HTML'

Go down to this line:

Move the second opening div <div class=... to a new line and click on the page.
The service name moves to the next line.

@NickColley
Copy link
Contributor

NickColley commented Jun 25, 2018

Thanks for helping us with this.

I see a few possible solutions:

  1. Use floats and clearfix
  2. Add comments into the template itself
  3. Don't pretty print html
  4. Do the font-size trick https://css-tricks.com/fighting-the-space-between-inline-block-elements/#article-header-id-3

It feels like 1. would be the most robust

@pds2208
Copy link
Author

pds2208 commented Jun 25, 2018

Please don't do 2 or 3....

@NickColley NickColley added the 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) label Jul 4, 2018
@NickColley NickColley self-assigned this Jul 10, 2018
@36degrees 36degrees changed the title Header issue Service name falls below GOV.UK in header when there is whitespace between the two divs Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants