CMS Development

Jlawal
トップ投稿者

Menu alignment

解決

Hello all,

 

I am trying to get the 'Get app' in the top menu to float to the right, above the customer login button, but it is stubbornly floating to the left.

 

Do you know why it is doing this and how i can get it to float to the right?

 

Any help would be greatly appreciated.

 

Many thanks,

Jamila

0 いいね!
1件の承認済みベストアンサー
Jsum
解決策
キーアドバイザー

Menu alignment

解決

@Jlawal,

 

The element you are attempting to float right is set to 100% of its containers width so it has no where to move.

Instead of Float: right; as your inline styling on that element, try text-align: right;. The outer most wrapping around your text, that is not 100% width, is a span tag. Span tags are inline items so the are effected by text rules like alignment, and inherit from their parents. Setting the raw html container's inline styles to "text-align: right;" does what you need.

 

 

Need help? Hire Us Here

元の投稿で解決策を見る

3件の返信
Anonymous
適用対象外

Menu alignment

解決

Hi @Jlawal,

You can add this CSS,

 

.top-header {
    text-align: right;
}
Jsum
解決策
キーアドバイザー

Menu alignment

解決

@Jlawal,

 

The element you are attempting to float right is set to 100% of its containers width so it has no where to move.

Instead of Float: right; as your inline styling on that element, try text-align: right;. The outer most wrapping around your text, that is not 100% width, is a span tag. Span tags are inline items so the are effected by text rules like alignment, and inherit from their parents. Setting the raw html container's inline styles to "text-align: right;" does what you need.

 

 

Need help? Hire Us Here

Jlawal
トップ投稿者

Menu alignment

解決

Thank you for that breakdown @Jsum

 

That works perfectly and your solution makes sense. I'm going to keep inline styles in containers going forward! ロボット ハッピー