I'm trying to put html code to a design mockup my boss provided, and some of the aesthetics - the shape of the search bar, for example, are a little bit bizarre and complex. As an easy fix, I thought I would simply put a text field over an image of the search bar, but I can't get it to work.
Can anyone suggest a way to layer a text field over an image, leaving it invisible but still functional?
As far as the invisibility goes, put this CSS on your input:
input {
background: transparent;
border: none;
}
Check out this jsFiddle that shows this in action. As far as positioning the input goes, you should be able to handle that normally.
Related
I am trying to replicate a design element and remove the image and hopefully replace it with plain HTML/CSS. Essentially I have a header > h1 that has a title in it. For example we'll say this title is "Stack Overflow", like so..
<header>
<h1>
Stack Overflow
</h1>
</header>
In my current CSS, the text-indent is pushed off the screen and a background is applied to the h1.
To replace that I'm using the -webkit-text-stroke: rule which works fine, albeit not being fully supported across all browsers. The problem with it is one that many Photoshop users come across when applying stroke to text and that is the position of stroke.
Let me demonstrate with a badly put together image: https://i.imgur.com/eQC9B5v.jpg - the top text shows stroke that is "outside" of the text, the bottom one uses what Photoshop calls "center".
It seems that -webkit-text-stroke based it's stroke on that "center" variant in Photoshop. I'd very much like it to replicate the "outside" option.
I can't see anywhere I can set this, and I'm guessing I can't but I'd be interested to know if..
a) there is a method, and if so what is it?
b) if there isn't a method, has anyone found a different way of achieving this?
Now I should say, I found this: https://www.petercarrero.com/examples/stroke which in turn came from a post posted on here in 2013 (CSS- webkit-text-stroke but stroke covers font-color)
On caveat here is that I believe SVG can control the stroke type and I would be interested to see any solutions that use it, but ideally I am not targetting an SVG solution.
Thanks in advance.
Let's say I have the following section on a form
Form Section:
Data:_____________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
and I want to be able to insert {{ data }} into the section while keeping every line (even if it's unused). I'm doing this for work to replicate an old form. This form has to be identical and that's why I can't simply do something like:
<u>{{ data }}<u>
Thanks in advance for any and all help!
There seem to be a couple of options here;
Hacky: Use multiple text inputs. Style them to have a solid bottom border (as the underline) and use a bit of javascript to handle moving between them on word wrap/arrow key movement. Downside: you'll miss something like handling text readers properly, obscure keyboard shortcuts, etc... Also, while pasting is fairly easy, copying would be a pain.
Use a textarea with a background-image with the lines. This relies on you locking down the font size/line spacing to look right
Html5: look into using contenteditable attribute. you should be able to replicate the appearance fairly easily using css and divs/spans. Then make the right one editable
This post might be helpful. How to underline blank space in CSS?
In their example, you would put your template code in the first span.
I've been looking around but there doesn't seem to much help on this.
Basically I've adjusted my text selection to a different colour, easy done. However, I was wondering how to code the selection to select to the edge of the page rather than just the text on it's own.
I've attached a screenshot of a working example to show you what I mean.
thanks
I would suggest css style:
display: block;
Working with Bootstrap I wanted to make a replica of http://spring.io/projects; a grid of links that are each a bordered panel (might not be the right word...) with some words an a picture inside. I've come to a conclusion, that Bootstrap's Thumbnail component should be right for me.
Having tried to use it, however, I ran into a problem.
If I want the entire panel to be clickable, I have to apply the thumbnail class to an anchor tag (wrapping the anchor into a div with thumbnail doesn't seem to work). Then, inside the anchor tag I've got a div tag with the class caption in it to store some text whose styling I don't want to change upon hovering on the panel.
What this caused is this: the text regained normal colour (as compared to the link colour when used without the caption class, however hovering over the panel causes the text to get underlined, and I'd prefer if that was not the case: it doesn't look very good and the highlight of the border upon hover is already a good indicator of that it is indeed a link.
I was about to just get my css hat out and modify the caption class to not do this, but it doesn't seem like the right course of action; I can't imagine it being desirable behavior for captions to get highlighted like this, and I'd like to use as little custom code as possible (since sticking to standards means I won't have to maintain this code every time I update bootstrap).
So my question is: where am I going wrong? Is it actually bad practice to want the entire thumbnail panel to work as a link? Or should I go ahead and manually scrape the underlining off? Or am I maybe applying wrong classes to wrong tags? Or is the thumbnail component not a right component for me to use altogether in such a case?
EDIT:
Forgot to include the code.
The thing I'm currently using:
<a class="thumbnail text-center" href="#">
<div class="caption">
<h3>Potato</h3>
<p>Some short description of what this exact potato really is about.</p>
</div>
</a>
EDIT 2:
Adding an image of what is currently occurring:
This is with the mouse hovering over it; as you can see, the text is underlined, which is not ideal.
Really weird that you ask this question because I just read a thread on this not so long ago and still have my solution which I have turned into a FIDDLE for you.
If I understand your question correctly, you want the entire panel / div to be a link, which can be accomplished like this: (This is the OP's steps, cant remember them word for word)
Make your Div position: Relative;
create a link
put span tags into that link <span></span>
Style the empty span tag with
CSS:
{
position:absolute;
width:100%;
height:100%;
top:0;
left: 0;
/* edit: added z-index */
z-index: 1;
/* edit: fixes overlap error in IE7/8,
make sure you have an empty gif */
background-image: url('empty.gif');
}
I think that's all there is to it. Like I said... There is a thread somewhere on this, but I cant remember what it was called.
Hope this can help.
EDIT: So after a long debate, we can forget about the above AND we came to the conclusion that this is possibly what you are after? :)
Add a tiny bit more CSS to your solution and you are sorted...
a.thumbnail:link {
text-decoration:none;
cursor:pointer;
}
Here is an updated fiddle
The solution is to add on the top of your style sheet:
a:hover {
text-decoration: none;
}
I am trying to get text to show above some horizontal lines. But try as I might the text always show underneath.
Here is the code
http://jsfiddle.net/mrchin/uTsxZ/
Can anyone see what I need to do? I've always done layout in flash and am still learning css. Any help appreciated.
Positioning the text relatively seems to work:
#txt_projects
{
position: relative;
}
You need to use background image to display lines underneath the text.
I updated your code, please review.
http://jsfiddle.net/uTsxZ/4/
if you need a tripple line, you need to modify your background image to do that.