How to always add style in one site - html

I use a site at work that has unordered list "ul" with a lot of "li" elements without borders, I would like to always highlight the "li" elements to have better readability.
What I do at this moment is right click the page and open the inspector and add this line:
<style>li:hover {background-color: #ffff99;}</style>
It works but I'm wonder if I can do a plugin for this or if there is another way to do it automatically (I have already send a request to the developer of the site to request this change but while I wait I would like to know what would be the best approach to automate this task)
The list look like this:
File.txt 85215165
File2.txt 96312121
File3.txt 41212123
File4.txt 65623443
File5.txt 69532055
... and so on
(It's not a continuous string, the file name and the number are elements inside the one "li" element and I'm not able to select them at the same time with the mouse)
And it has no style so it's difficult (at least for me) to see which number in the right match the file name in the left.
Note: The list is generated with a script and when I try to see the code of the page (right click see source code) I don't see it, I just see the script, that's why I do it with the inspector

This may solve the issue:
Stylish or Stylebot -- Chrome plugins -- both seem to add your preferred CSS on top of the specific websites you choose.

Paste this in the browser console, slightly faster and easier than editing HTML tags from within the tree in the inspect element tab.
document.head.insertAdjacentHTML("beforeend", `<style>li:hover {background-color: #ffff99;}</style>`)

Related

Load a chrome webpage using my own customized "elements"

I edited a webpage with customized elements. The elements were edited with the chrome F12 dev tool.
The problem is, every time I refresh the webpage, my edited elements will be reverted back to the originals.
This is what I want to do: next time when I load the same webpage, I want to have my edited elements, instead of the original elements. This way I don't need to manually edit those elements again.
Is there a simple way to do it?
I checked this Save Chrome dev console html changes but it seems not too helpful for my case.
One possible solution is to create my own webpage, and then use the edited elements in my webpage. Not sure if this will work; and it involves a lot of work.

How to show completed html source on chrome?

I'm trying to take the full html source of the tab in
this page
I want to take the source of
this tab
But unfortunately, the html I'm getting is not completed.
I registered a gif to explain it better
That select list is showing just when I inspect the element, while If I just insect the element with the list closed, it doesn't return any list html.. is it created dinamically when the user click on it?
I've tried to expand all the codes, but unfortunately it seems the html of every list is not appearing.. It might be created just when I open the list?
Is there a way to get the lists html?
Hope I've been clear.
Not sure what you want to save, but by inspecting it sources, it seems that the website use the way of removing and appending the html source which means only you pressed the expanded button, Javascript will append it (different options) to the body, otherwise it will not shown in the element tab.
I don't think you could get all html tags in just 1 try because the website use Javascript to append the html and you can't see it in the element section in console when the element is being removed.
Example:
You can save the page if you want. Just save it with Ctrl+S and you will find the basic source in there along with the stylesheet and other scripts.

Updating a Drupal Site and all I have is a HostGator login

As a favor for a friend, I'm trying to add a quick Valentine's Ad for an article that is supposed to be appended to the top of their existing site starting... tomorrow. They have an existing site made by somebody they are no longer in contact with back in 2010 built with Drupal.
I don't know Drupal. The only information I have is a HostGator login that I'm currently using to send a backup zip to my email.
HostGator's File menu doesn't even show search results for the text I'm searching for on the main page where I'd put this.
I have no idea what I'm doing, basically. I'm comfortable as a web developer in general and figured "yeah I can add a thing to the top of your pages, sure." I can write that HTML quickly, but everything else... do I need Drupal installed, etc, and will that run with the backup that HostGator is gonna send me?
Any advice? I realize I'm an idiot for signing up for a favor like this last minute.
Ultimately I just need to add some pictures and some text.
Easiest way to achieve this would be creating custom block. Not sure what version of Drupal you use, but let's assume it's D7 (similar for other versions):
Go to Structure -> Blocks -> Add block
Enter your static content into "Block body" field. Change that field format to "full html" so drupal won't filter out some of your tags.
If you don't want Drupal's block title to appear in Block title field enter < none > (without space signs in between! - SO can't show it without spaces).
Save your block
Now go to Structure -> Blocks...your block should be visible in block list. You can find and edit it from there.
Theme site uses has "Regions" (something like sidebars). If want your block to appear with main content find your block and select "Content" region. Or any other you want.
At top of that page should be a link "Demonstrate block regions" - click it to see which region is where..
After selecting region you can click "configure" link for your block to precise in what conditions block should appear on page. Click it.
Scroll down and in right sidebar at bottom of configure page you'll see "Pages", "Content types"... it for selecting on what pages, on what content types...your block should be visible. Default is everywhere, so if you need this - use it.
Save block. If you didn't save on Structure -> Block after selecting region select region again and Save.
You can embed your CSS there, but you can also go to (usually): /sites/all/themes/your_theme/styles/style.css or something like that.
If you can't find CSS turn the caching off for a moment: Configuration -> Development -> Performance and inspect location of loaded CSS file(s) (use browser inspection tool).
Good luck!

Automatically save CSS changes made to existing styles in Chrome dev tools?

I've already mapped the necessary files to the local resource - however, while that does allow me to save any changes made to a file in the Sources panel, I was wondering if it's possible to automatically save changes to CSS made in the Elements panel. Otherwise at the moment, any changes made to the style in the Elements panel seem to exist only there.
I remember at some point there used to be a little indicator of the file and line number next to a class/id etc. in the Styles tab of the Elements panel - surely it can't be that hard to simply 'update' any changes to that style rule considering Chrome knows exactly where it's coming from (in the case that it's a stylesheet and not an inline style?). It would be a great relief to my workflow.
The answers to this similar question are obsolete.
When you have finished making your changes in the Elements tab. Next to the style there should be a link with the file name there, something along the lines of site.css:4 or similiar, if you click on that link it will open up the sources tab with that certain page what you have editied containing the modifications. Then you can go to save as, and then save the document from there.
I hope this helps you out :)

Copying HTML code in Google Chrome's inspect element

I have a website of which I want to copy an HTML code from - how do I copy all the text in inspect element - so I don't get the website's HTML code, but the code that I have already changed so that I don't have elements I don't want in my own webpage?
Do the following:
Select the top most element, you want to copy. (To copy all, select <html>)
Right click.
Select Edit as HTML
New sub-window opens up with the HTML text.
This is your chance. Press CTRL+A/CTRL+C and copy the entire text field to a different window.
it's the easiest way to do this.
Right click → copy → copy element
Select the <html> tag in Elements.
Do CTRL-C.
Check if there is only lefting <!DOCTYPE html> before the <html>.
Using HTTrack software you can download all the website content to your local directory.
HTTrack: http://www.httrack.com/
This is bit tricky
Now a days most of website new techniques to save websites from scraping
1st Technique
Ctrl+U this will show you Page Source
2nd Technique
This one is small hack if the website has ajax like functionality.
Just Hover the mouse key on inspect element untill whole screen becomes just right click then and copy element
That's it you are good to go.