Changing the style of TinyMCE dropdowns using CSS

I successfully incorporated the tinyMCE editor into my Vue.js Application.

init = {
      height: 500,
      menubar: false,
      plugins: [
        'advlist autolink lists link image charmap print preview anchor',
        'searchreplace visualblocks code fullscreen',
        'insertdatetime media table paste code help wordcount',
        'image imagetools',
      ],
      toolbar:
        'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | image code | help',
    }

An issue arises when I try to click on options in the TinyMCE Editor, such as Paragraph. The options list drops down instead of appearing like a dropdown. https://i.sstatic.net/HZO5O.png

I attempted to utilize the class of the paragraph option and override the CSS associated with it, but it seems to be reverting back to the default CSS. Is there a method for effectively overriding the CSS of the options in the TinyMCE Editor?

#. Update I managed to successfully override the CSS

{
    position: absolute;
    left: 534.828px;
    top: 312.203px;
    max-height: 341px;
    overflow: hidden auto;
    min-width: 130px;
}

This was achieved by applying a media query to it

 .tox .tox-menu.tox-collection.tox-collection--list {
    top: -38rem !important;
    left: 39rem !important;
  }

Is there a more efficient way to achieve this without resorting to writing media queries?

Answer №1

Although it may appear similar to a media query, this is actually a CSS selector. In the event that the plugin does not offer a direct method for injecting styles, utilizing !important will suffice.

In essence, it serves to override the default styles in place.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the Vertical Metrics of Various Typeface Styles

I'm encountering a problem and struggling to find a solution. I'm in the process of creating a website and incorporating various fonts. My goal is to ensure that every font appears visually similar to the others and align perfectly at the base. ...

Create a custom calendar in Vue.js that allows you to dynamically disable specific

Recently, I've been working with vue.js and I've come across an issue regarding how to apply a class to past and future days of the current month. Specifically, for March, I need to disable days with numbers 24, 25, 26, 27, 28, 29 in the first ro ...

How can I center align all images using Bootstrap?

My current grid images are aligned in a specific way. https://i.sstatic.net/RmNE9.png However, I aim to adjust the grid images to look like this, specifically focusing on centering "img 1". How can I achieve this? https://i.sstatic.net/frNvp.png HTML ...

Loading images in advance before webpage loads

Welcome friends! This is my first time asking a question here, so I hope I'm doing it right :) I'm looking to preload 3 images before the webpage fully loads so that they all appear simultaneously. Currently, the images load one after another and ...

Is it possible to customize the background color of select2 boxes separately for each option?

I recently implemented the select2 plugin and now I'm looking to add a new class within the .select2-results .select2-highlighted class in order to change the background color. Does anyone have any suggestions on how to achieve this? ...

Ensuring a top margin is applied to a flexbox item of undetermined height

Having a flexbox container with two dynamic content columns, it becomes challenging to adjust the height of the right column without affecting the alignment. Setting a top margin does not yield the desired result as the bottom remains aligned with the left ...

Building Dynamic Forms with React.js and Bootstrap for Easy Input Field Management

In the process of developing a web application using React.js and react-bootstrap, I encountered an interesting challenge. On one of the form pages, users should be able to input symptoms of an illness they are dealing with. The key functionality required ...

Passing arrow functions for input validation rules to the Stancil component in Vue

I am attempting to implement an arrow function as input rules, similar to the setup in Vuetify at https://vuetifyjs.com/en/api/v-input/#rules. My approach involves passing rules within an array using the following code: <body> <div id="ap ...

Setting a variable before a debounced method function in Vue: Tips and tricks

Is there a way to set isLoading = true prior to the function being executed? Currently, isLoading remains false until the debounced function is triggered. <script> import _ from 'lodash' export default { data: { isLoading: false; ...

The image slider on the front end is malfunctioning

Starting out as a novice on a new website project, I typically work with Dreamweaver and also do some hardcoding in HTML and CSS. This is why I decided to try my hand at Magento. While making a change in the CMS / Static Block section, I accidentally brok ...

Problem with traversing from parent to children elements using jQuery selectors

<form data-v-c4600f50="" novalidate="novalidate" class="v-form"> <div data-v-c4600f50="" class="pr-2" question="Top Secret4"> <div data-v-c4600f50="" f ...

Issue with Bootstrap dropdown functionality when used within a Horizontal description block

I'm struggling to get a dropdown menu to work properly within a horizontal description. The dropdown menu just won't toggle when clicked. <div class="container-fluid"> <div class="row vertical-align"> <dl class="dl-horizonta ...

Display a caption with a translucent color overlay when the mouse hovers over an image

I have created a code snippet that displays a caption with a semi-transparent red overlay when hovering over an image: HTML: <a href="http://www.domain.com/"> <div class="thumb"> <img src="http://www.domain.com/thumbnail.jpg" w ...

Using axios and jQuery for posting data

Exploring two different Vue methods: one utilizing axios and the other using jQuery: axios.post('./test.cshtml', { para: 'test_Axios', action: 'test' }) $.post('./test.cshtml', { para: 'test_JQ', action: ...

Need assistance with CSS layout: How to extend a div to the bottom of the page

I am currently working on a design layout that includes a 'header' section with a logo and links, as well as a content area that should extend to the bottom of the page. However, I am facing some challenges in achieving this. Initially, I enclos ...

Status and route redirection in Vue instance management

I am looking to establish a global status property for my application using vue.js and vue-router. This property should be shared between components and used to control access to certain routes based on its value. For instance, I want to redirect all rout ...

Display overlay objects specifically focused around the mouse cursor, regardless of its position on the screen

I am currently working on a project using SVG files and processing.js to develop a unique homepage that incorporates both animation and static elements. The concept is to maintain the overall structure of the original homepage but with varying colors, esse ...

Troubleshooting issue with alignment in Material UI using Typescript

<Grid item xs={12} align="center"> is causing an issue for me No overload matches this call. Overload 1 of 2, '(props: { component: ElementType<any>; } & Partial<Record<Breakpoint, boolean | GridSize>> & { ...

How to change from using position: sticky to fixed after scrolling to a specific div

Is there a way to transition the position of sticky content from sticky to Fixed while scrolling down and moving to the next rows, keeping it fixed until just before the footer, where it should scroll again? For example, <!DOCTYPE html> <html ...

Continuous horizontal columns

Is there a way to create horizontal columns with inline-blocks, like the method described here, without having vertical gaps between items on the second line due to different heights? I want to eliminate the vertical gaps between the tiles using only CSS. ...