This isn't an ATL, but rather a question about real history: why was Venice able to resist the Holy Roman Empire, when everyone else around them bowed to the Emperor? Later, of course, Venice was a medium-sized empire, far more powerful than most of the other Italian states - but in the early and mid-Middle Ages, Venice was just a city-state like any other, richer perhaps than most, but not extra special like it became later.