How to add custom css in wix website - css

I am new at wix and editing a website and want to add css in a page. but not found any option for css.
Anybody know how to add custom css code in wix website?
Thanks

You can do this by embedding inline styles to every page, via creating a chunk of custom css code contained between <style> and </style>.
Go to your site's dashboard.
Click Manage Website on the left.
Click Tracking & Analytics.
Click + New Tool **and select **Custom from the dropdown.
Set up your custom code:
Enter your custom code.
Select the relevant domain. Note: This option will appear only if you have multiple domains.
Enter a name for your custom code.
Add Code to Pages: Select which pages to add your code to:
**All Pages: **Click the dropdown to select an option:
Load code once.
Load code on each new page.
**Choose specific pages: **Begin typing the name of the relevant pages and then click the checkbox next to the relevant page.
Place Code in: Select where the code snippet in placed in your site's code:
Head - as noted by #Daniel Gurtner, avoid this because it'll insert it BEFORE any of the inherent styles, which makes it mostly useless here.
Body - start
Body - end Note: I'd recommend adding your style chunk here to avoid having a delay effect on your loading
Click Apply.

Wix keeps on updating this but I have found where the place described in the most voted comment is for now. I don't have enough "reputation" to add a comment to the thread, hence why this is an answer.
Go to Settings and scroll to Advanced(the last section) and you can see Custom Code. The rest of the steps are the same.

Click Add on the left in the editor.
Click More → Embeds.
Drag the HTML iframe to the site.
Click your iframe and click Edit Code.
Then type:
<style>
/* CSS Code */
</style>

As of 2022, you can add it from your Wix Dashboard under Settings > Advanced > Custom code.
Click the Add Custom Code button. Enter your CSS in the Paste the code snippet here: textarea. Make sure to wrap it within <style type="text/css"></style> tags. Set the Code Type as "Essential" as it doesn't require user consent to load.
Note: You won't be able to see your CSS from the page editor nor Preview mode. You have to Publish it and view it from the frontend.
Wix Add Custom Code screenshot

Follow these steps to add CSS in Wix.
Go to your site’s dashboard.
Click Manage Website on the left.
Click Tracking & Analytics.
Click + New Tool **and select **Custom from the dropdown.
Set up your custom code:
Enter your custom code.
Select the relevant domain. Note: This option will appear only if you have multiple domains.
Enter a name for your custom code.
Add Code to Pages: Select which pages to add your code to:
If you need more help with Wix Web Development visit wix.com/forum.

I just tried it on 6th Sep 2021. Yes it is possible to add CSS & JS custom code.
At the same place of writing custom HTML code
For CSS code add,
<style type:"text/css"> CSS CODE HERE </style>
For JS Javascript code add,
<script> JS CODE HERE </script>

The steps in previous answers did not work for me. It seems the interface has changed.
The following steps work with the new UI:
Go to your site's dashboard
Click settings in the left sidebar
scroll down to the "Advanced" section
Click "Custom Code"

All carriage returns within the embedded code will show up as \n on the output, rendering the code non-functional.

You could also achieve this by setting the .html property of your object (#id) in Velo.
The following example adds a drop shadow to your object with id equal to #id:
$w("#id").html = "<p style='filter: drop-shadow(1px 8px 4px #4444dd)'>test</p>"
Below snippet shows the result in pure HTML.
<p style='filter: drop-shadow(1px 8px 4px #4444dd)'>test</p>

You can't. This is not a feature provided by Wix.
ref. other ref.

Related

NEED HELP - how to make an excerpt of the post clickable?

I am working in Wordpress, and I am using Elementor. Elementor has a native feature for the title of the posts and images to link to the post.
But if I add an excerpt text, it doesn't link to the post. It is not clickable. The read more button does, but not the excerpt of the post.
I am trying to create something like this: greatist.com Every post on their website is clickable - the excerpt, the title, and the image.
My excerpts are really short like on that website, and I would really like them to be clickable. I have absolutely no idea how to do this and I'm beginning to think it's not possible. I am using Hello Elementor theme.
I would deeply appreciate anyone's help. I just registered to ask this question.
You can always try to save text as an photo and make it clickable or make a full section clickable.To do this try to use plugin called "Make Column Clickable Elementor".
Add this code to your website:
const postExcerpts = document.querySelectorAll('.elementor-posts .elementor-post .elementor-post__excerpt');
postExcerpts.forEach(postExcerpt => {
const postUrl = postExcerpt.parentNode.querySelector('.elementor-post__title a').href;
postExcerpt.addEventListener('click', () => {
window.location.href = postUrl;
});
});
This can be added using a script tag. Choose from the following options:
Add this code as a script tag in your functions.php file, to be rendered at the end of the page (wp_footer action hook).
If you have Elementor Pro, use its built-in Custom Code feature to add the code in a script tag to the end of the body tag.
It's recommended to add a pointer cursor so the user will know the excerpt is a link. This can be achieved by adding the following CSS to your style.css file.
.elementor-posts .elementor-post .elementor-post__excerpt {
cursor: pointer;
}

Only CSS to open link in a new tab

Hello I have the following problem: I have my website made in Wordpress, and I have a 3D Cover Carousel plugin there, which shows me a gallery of photos in 3d. The thing is that when I click on the image I want the link to be opened in a NEW tab. In the plugin settings there are no such an option. The plugin html is a short code added to my page. So the only thing I can change is Additional css. So is there any options to make a link be opened in a new tab only with css?
As it was previously stated here, there is no way to do this with pure CSS.
If you can use JavaScript, you can target the item and add it the attribute target="_blank".
document.getElementById("element").setAttribute("target", "_blank");
document.getElementById("element").setAttribute("target", "_blank");
You can add this piece of js in your footer.php file.
Another method is to add a js file and include it using wp_enqueue_script function in your function.php file.

how do i locate files in wordpress by inspecting element a particular element in google chrome?

I want to change some particular line on my Wordpress site which I cannot change in the customization. How do I locate a certain line with inspect element in chrome?
My website is www.Artiana.io and I want to edit this line:
"<h5 class="subscribe-description">Learn more</h5>"
Please, can anyone help me out?
Let me show you how you can use WordPress's hints in html body class to find the php file:
WordPress gives hint in the HTML's body tag that which particular template was used to display this page.
In your case we have following classes in the body tag:
<body class="home page-template page-template-page-templates page-template-page_front-page page-template-page-templatespage_front-page-php page page-id-466 custom-background wp-custom-logo blog-post">
Now there is a specific class which ends with php, which tells that template was used by your theme to build this page. i.e. page-template-page-templatespage_front-page-php
Now it could mean that in your theme folder:
/wp-content/themes/hestia/
There could be sub folder or folders called: **page-template/page-templates** and inside it is page_front-page.php PHP file, which is being used to create this layout. See if you can locate the code you are trying to modify there.

Adding custom CSS to Drupal 7 to hide the message

I use my custom block for displaying a flash game at the front page of my Drupal 7 installation, but there is also the annoying message:
<div id="first-time"><p>No front page content has been created yet.</p>
<div class="item-list"><ul><li class="first last">
Add new content</li>
</ul></div></div>
below it and I can't remove it. Is there please a hook for adding custom CSS? In my module I would like to make the #first-time light grey or invisible.
I prefer not to add a blank content just to get rid of that text.
Thank you!
Alex
UPDATE:
I've added the following to my module:
function game_init() {
drupal_set_message('XXX init called XXX');
if (drupal_is_front_page()) {
drupal_add_css('#first-time {color: green;}', 'inline');
}
}
but don't see that CSS-code or XXX string inside my front page.
UPDATE2:
Oh, I had to clear the cache and now it works (the Drupal docs seem to be wrong here - there was written that 'inline' CSS is not cached...)
Hiding the CSS is the WRONG way of doing it. why did you created your content as a Custom Block?
you should create a "Page" and set this page as front page in the Configuration->Site Information.
Whatever. you can also use any of these options but is not recommended.
you can also also add a BlankPage by Adding only the Title(then hiding it in PHP on page.tpl.php)
you can add your css in /templates/themes/bartik.info
you can call drupal_add_css on the _init() hook of your custom module.
Blocks are used to display information in every page(although we can set to display only on certain pages). Say For Example. A Menu, or A Shopping Cart etc.
If you want to add some CSS for a module, you should use drupal_add_css()
Why not simply add this CSS to your theme?

How to change tinyMCE editor's button's default tag output in wordpress?

Wordpress Tiny MCE editor and WP own editor both has button for <blockquote> . if we select any text and press this buttom then it wraps that text with <blockquote>.....</blockquote>.
I want to change this output to this
<blockquote><div class="quote_start"><div></div></div><div class="quote_end"><div></div></div>...................................</blockquote>
How can i do this manually or is there any wordpress plugin which can do the same?
I want to change behaviour of blockquote button in bot editor TinyMCE and WP own html editor?
I'm not sure you can use this to add that many divs but tinymce's valid elements config parameter does allow you to replace tags.
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements
For instance:
tinyMCE.init({
valid_elements : "blockquote/div[class=quote_start]"
});
Would replace all blockquote tags with a div with the quote_start class.
A better way might be to ignore tinymce here and write a filter for the functions.php file of your theme. http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content. Find all the instances of blockquote and replace it with the code you want.
Maybe adding your own button could also be an option?
Some starting point could be this:
http://www.deliciousdays.com/tinymcebuttons/
and/or this:
http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/addButton
hope it helps? Greetz, t..
If you want the same functionality in two different editors, you're probably better off writing (or looking for) a Wordpress filter that can replace the code. There's this one but it doesn't seem to be able to handle regular expressions (which you would need to replace HTML tags). Maybe this one can do what you need: Text Filter Suite
Getting both TinyMCE and Quicktags requires mods in two places. Here's how to do the Quicktags:
http://website-in-a-weekend.net/extending-wordpress/diy-wordpress-unraveling-quicktags-wordpress-plugins/

Resources