I have a little bit of a problem here. I am making a kind of chat application in Flash CS5, using Action Script 3, and I am trying to make URLs that appear in the main chat textbox (where all of the things that other people have said come up), which is a TextArea component, be converted into HTML link tags. I have this working, but the problem I am facing now is that the links appear black. I want them to appear with an underline, and blue text. I am formatting the TextArea with TextFormat, and I am using some of the functionality that is only available in TextAreas, so I cannot use plain dynamic labels.
I have also tried using the style attribute of the link tag, but that didn't do anything.
How can I change the formatting for the link tags to appear blue and with an underline?
My current code for changing the links to HTML link tags looks like this:
txtOutput.htmlText += replace(/(?:http|https):\/\/\S*/g, function ():String
{
return '' + arguments[0] + ''
});
have a look at style sheets you can implement hyperlink styles form there.
update:
The textArea has a textField property. try applying he style sheet to that.
Related
I am trying to change the font style in google app script for a card service in gmail add-in.
Sample code -
CardService.newCardBuilder()
.addSection(CardService.newCardSection()
.addWidget(CardService.newTextParagraph().setText("Sample Text"))
In the above code 'color' is working fine but not the 'size' attribute and also I am trying to align it to right.
Is there any way to make things happen? Or any better approach for the problem?
The TextParagraph that CardService.newTextParagraph().setText("Sample Text") returns another TextParagraph for chaining.
TextParagraph supports basic HTML formatting.
When setting the text content of these widgets, just include the corresponding HTML tags.
For example:
CardService.newTextParagraph().setText('<font color="#ea9999">test</font>')
I am in the process of making a form for my website and I need some tooltips on my input fields that explains what the user should type in that field. I've looked around for ways to style the title attribute as well as several ways with "span" and other tags, but nothing seems to work. Some of the methods worked on text, but none of them worked on an input field.
Is there any way to make such tooltips on input fields? The simpler the better.
Several ways to do this,
Jquery UI for example comes with a way to do this (https://jqueryui.com/tooltip/ )
or you could use a as a tooltip and trigger it on hover (or whenever) via js, this example: this example by Eric Kidd is quite similiar.
What you need to do to display your tooltip on hover basically is:
Style a label to be displayed whereever you want it(this will be your tooltipbox)
Define a .is-active class, which hides your label if it is not attached to your form-input
trigger the class on hover, for example like this
$(".form").mouseenter( handlerIn ).mouseleave( handlerOut );
function handlerIn () {
this.addClass("is-active");
}
function handlerOut () {
this.removeClass("is-active");
}
i am unable to find these symbols for HTML buttons.
please tell me how to put these symbols on HTML buttons.
If you want to add arrow symbols to as text to button in HTML, you have several options.
Select a font that features arrows and use it.
Use Unicode symbols with the &<identifier>; syntax and use a code from this page.
If a custom image is what you're after, download or locate the image you want to place on the button and apply the following css to your button, replacing the url with the one from the image.
.button {
background-image: url('image/url/image.png');
}
I have a SVG logo i want to place a few times on a single page. Each time it should show up in a different color. That colors are defined via the Wordpress backend. The colors get applied with a snippet like that:
<div class="logo" style="fill:<?php the_field('op-about-color', 'option'); ?>;"></div>
The SVG is placed in the CSS and is base64 encoded. Inside the <svg>tag i've also included the class logotest. But the problem is the SVG isn't getting colored. I've created an example pen with the base64 encoded svg:
http://codepen.io/rpkoller/pen/DuqBh
It stays black.Opposite to the fact that the inline style filled it red and even the assignment of the fill color green for the sktest class has no effect at all.
If i place an unencoded svg code right into the html into a div everything works as expected. Inline style assignment as well as with the logotest class:
http://codepen.io/rpkoller/pen/rdFup
Is there a way to get things going with the base64 variant? Best regards Ralf
Your problem is in your implementation. It's not necessarily that base64 is the issue so to speak, but the difference between including the image as a CSS background, versus including it in HTML.
In HTML... You literally can read the code of the SVG in the HTML. Because that HTML markup exists in the DOM, it is editable via CSS through your classes. If you were to right click the page and click "View page source" you would see the code of the SVG in the HTML.
In CSS, you are adding the image as a background image. Background images don't get any sort of HTML markup that is outputted into the DOM. It is... an "effect" if you want to say it that way, which is applied to some HTML element that you define. If you right click the page and click "View page source" you will see the element that you are applying the background image to, but there is no additional markup outputted that further CSS could then read and modify.
What are your options? Well, you could apply the inline styling directly to the SVG image, but that isn't in any way dynamic, so you won't be able to do your back-end snippet for class names and such.
The other option is to include the SVG like you have done already, which is called "Inline SVG". This way you can effect it with CSS code.
I've got a <textarea>, but I need to color specific lines different colors. Apparently, I can't do this.
I could perhaps use a <div>, but I like the look and scrollbar of a <textarea>.
Is there any sort of database of HTML elements somewhere that I can check? It's rather annoying having to burden the posters of StackOverflow whenever I can't place the name of an element.
Textareas can only contain plain text. No possibility to format via CSS. You need something like a WYSIWYG Editor (CKEditor or TinyMCE)
Or if readonly, filled by javascript:
Use a simple div which can contain HTML markup inside for your line colors. Then style it with CSS to look like a textarea (scrollbar maybe)