Táco is wider than Taco. How can I fix that?
div.text { width: 75%; position: relative; font-family: monospace; }div.diacritics { width: 100%; height: 100%; position: absolute; top: 0; left: 0; font-family: monospace; z-index: -1; color: red; }
<div class="text">String String String String String String String String String String <div class="diacritics"> Stríng Stríng Stríng Stríng Stríng Stríng Stríng Stríng Stríng Stríng</div> </div>
<div class="text">Taco Taco Taco Taco Taco Taco Taco Taco Taco Taco <div class="diacritics"> Táco Táco Táco Táco Táco Táco Táco Táco Táco Táco</div> </div>
How can I use the exact width of wrapped text rather than that of the full container?
Could work for short text. Combining attr()
and pseudo
.
.outer { width: 200px; background-color: #ccc; border: 1px solid black; display: inline-block;}.inner { display: inline; position:relative;}.inner:before { content: attr(data-text) " "; color: transparent; position: absolute; left:0;top:0; border: 1px solid red; pointer-events: none;}
<div class="outer"> <div class="inner" data-text="Supercalifragilistic expialidocious">Supercalifragilistic expialidocious</div></div>
use of + sign in Google Adwords
You can add a modifier, the plus sign on your keyboard (+), to any of the terms that are part of your broad match keyword phrase. By adding a modifier, your ads can only show when someone's search contains those modified terms, or close variations of the modified terms, in any order. The modifier won't work with phrase match or exact match keywords.
Example: +women's +hats
Example Search: hats for women
Unlike broad match keywords, modified broad match keywords won't show your ad for synonyms or related searches. For this reason, it adds an additional level of control. Using broad match modifier is a good choice if you want to increase relevancy even if it means you might get less ad traffic than broad match.
More information here: https://support.google.com/adwords/answer/2497836?hl=en&authuser=1
What exception should I throw if the type of T isn't supported?
No exception type is appropriate here because the situation makes no sense.
I would reconsider your design. You claim that Foo
is generic, but it can only accept one of two supposedly orthogonal types. If there is no common base type or interface between Bar
and BarFoo
, then how can Foo
be generic?
What do you do with ID
that can apply to either Bar
or BarFoo
(but nothing else) without reflection or a ton of switches depending on the type?
You could try creating an abstract
generic type with concrete implementations:
public abstract Foo<T> {
}
public FooBar : Foo<Bar> {
}
public FooBarFoo : Foo<BarFoo> {
}
but there's nothing stopping someone from implementing another type that uses something other than Bar
or BarFoo
. But at least there's not an easy way to use some other type.
Related Topics
How to Style the Arrow of <Details> <Summary> Elements
Word Wrapping for Button with Specified Width in IE7
Schema.Org Newsarticle: Invalid Value for Logo Property
Avoiding Repeated Constants in CSS
When to Use <Span> Instead <P>
CSS to Align Label and Inputs on Form
When Printing Tables in Google Chrome, Content Overlaps Header
How to Use Webp Images and Support Safari
Can Outlook 2010 Use a Web Font in an HTML Email
Chrome Does Not Expand Flex Parent According to Children's Content
How to Make Firefox Auto-Refresh on File Change
Pure CSS Rotate Animation Broken While in Infinite Loop
HTML Maxlength Attribute Not Working on Chrome and Safari
Making an Svg Image Object Clickable with Onclick, Avoiding Absolute Positioning
How to Display Text Around Circle. CSS Shape-Outside
Hide Text, But Have It Show Up If Copied and Pasted Without JavaScript